Electrical meter for determining a power main of a smart plug

ABSTRACT

An electrical panel or an electrical meter may provide improved functionality by interacting with a smart plug. A smart plug may provide a smart-plug power monitoring signal that includes information about power consumption of devices connected to the smart plug. The smart-plug power monitoring signal may be used in conjunction with power monitoring signals from the electrical mains of the building for providing information about the operation of devices in the building. For example, the power monitoring signals may be used to (i) determine the main of the house that provides power to the smart plug, (ii) identify devices receiving power from the smart plug, (iii) improve the accuracy of identifying device state changes, and (iv) train mathematical models for identifying devices and device state changes.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.17/106,949, filed Nov. 30, 2020, and titled “DETERMINING DEVICE STATECHANGES USING SMART PLUGS”.

U.S. patent application Ser. No. 17/106,949 is a continuation of U.S.patent application Ser. No. 16/179,567, filed Nov. 2, 2018, and titled“DETERMINING A POWER MAIN OF A SMART PLUG”, now issued as U.S. Pat. No.10,878,343 on Dec. 29, 2020.

U.S. patent application Ser. No. 16/179,567 claims the benefit ofpriority to U.S. Provisional Patent Application Ser. No. 62/740,201,filed Oct. 2, 2018, and titled “POWER MONITORING USING SMART PLUGS”.

Each of the foregoing applications is incorporated herein by referencein its entirety.

BACKGROUND

Reducing electricity or power usage provides the benefits, among others,of saving money by lowering payments to electric companies and alsoprotecting the environment by reducing the amount of resources needed togenerate the electricity. Electricity users, such as consumers,businesses, and other entities, may thus desire to reduce theirelectrical usage to achieve these benefits. Users may be able to moreeffectively reduce their electricity usage if they have informationabout what devices (e.g., refrigerator, oven, dishwasher, furnace, andlight bulbs) in their homes and buildings are using the most electricityand what actions are available to reduce electricity usage.

A power monitor can be installed at an electrical panel to obtaininformation about electricity used by many devices in a building. Apower monitor on an electrical panel is convenient because a singlemonitor can provide aggregate usage information about many devices. Itis more difficult, however, to extract more specific information aboutusage of power by a single device, since the monitor typically measuressignals that reflect the collective operation of many devices, which mayoverlap in complex ways. The process of obtaining information about thepower usage of a single device from an electrical signal correspondingto usage by many devices may be referred to as disaggregation.

Power monitors for individual devices are also available for measuringthe power usage of a single device. For example, a device can be pluggedinto a smart plug, and the smart plug can in turn be plugged into a walloutlet. These smart plugs can provide information about power usage forthe devices they provide power to, but it may not be practical tomonitor all or even many devices in a house or building with these smartplugs, because it may require a large number of smart plugs that may beexpensive and require significant manual effort to install.

To provide the greatest benefits to end users, a need exists for moreaccurate disaggregation techniques, so that end users receive accurateinformation about the electrical usage of individual devices.

BRIEF DESCRIPTION OF THE FIGURES

The invention and the following detailed description of certainembodiments thereof may be understood by reference to the followingfigures:

FIG. 1 is an example system for identifying devices and state changes ofdevices using power monitoring and network monitoring.

FIG. 2 is an example system for power monitoring and network monitoringillustrating electrical mains and circuits.

FIGS. 3A-C are examples of power monitoring signals from mains and asmart plug.

FIG. 4 is an example of a system for a service for power monitoring andnetwork monitoring.

FIG. 5 is an example list of devices.

FIG. 6 is a flowchart of an example implementation of identifying anelectrical main that provides power to a smart plug.

FIG. 7 is a flowchart of an example implementation of determining that adevice receives power from a smart plug.

FIGS. 8A and 8B are flowcharts of example implementations of identifyingdevice state changes using a main power monitoring signal and asmart-plug power monitoring signal.

FIG. 9 is a flowchart of an example implementation of trainingtransition models for a device using a smart-plug power monitoringsignal.

FIG. 10 is a flowchart of an example implementation of trainingtransition models for a device with three or more states using asmart-plug power monitoring signal.

FIGS. 11A and 11B are example state models for a device.

FIGS. 12A and 12B are example power monitoring signals for a device.

FIG. 13 is an example of a device for processing a smart-plug powermonitoring signal.

DETAILED DESCRIPTION

Described herein are techniques for identifying devices and determininginformation about state changes of devices in a building. One source ofdata in determining information about devices in a building is theelectrical line that provides power to the devices in the building.Electrical sensors may be placed on the electrical line (or lines) thatare providing power to the building, and disaggregation techniques maybe used to determine information about individual devices in thebuilding. For example, any of the techniques described in U.S. Pat. No.9,443,195, which is hereby incorporated by reference in its entirety forall purposes, may be used to determine information about devices usingelectrical measurements.

Another source of data for identifying devices or determininginformation about device state changes in a building is a computernetwork in the building. A building may have a network, such as a localarea network, and devices may connect to the network via a wire (e.g.,an Ethernet cable) or wirelessly (e.g., Wi-Fi). A building may havemultiple networks, such as local area network coordinated by a wirelessrouter, a mesh network created by other devices working in cooperation(e.g., Sonos speakers), or a personal area network (e.g., a Bluetoothconnection between devices). For example, any of the techniquesdescribed in U.S. Pat. No. 9,699,529, which is hereby incorporated byreference in its entirety for all purposes, may be used to determineinformation about devices using network data.

Some devices may be powered by the electrical line in the building butmay not have a network connection (e.g., a conventional refrigerator).Some devices may be powered by the electrical line in the building andhave a network connection (e.g., a “smart” refrigerator). Some devicesmay have a network connection but may not by powered by the electricalline (e.g., mobile devices, such as smartphones) or may only sometimesbe powered by the electrical line (e.g., when charging). The techniquesdescribed herein may provide more information and/or more accurateinformation about devices in the building by using a combination ofinformation from the electrical line and information from a network inthe building.

The information from the electrical line and from the network in thebuilding may be used to provide a service to users to inform them aboutthe status of devices in the building. A company may provide a powermonitoring device (or power monitor) that may be installed in thebuilding and connected to both the power line and the computer networkof the building. The power monitoring device may use both the electricalline and network data to determine information about what devices arepresent in the building and also the states of the devices (e.g., on oroff). This information may then be made available to a user, such as bypresenting it in a specialized application or app (e.g., on asmartphone) or a web page. The service may provide the user withinformation about devices in the building, such as real-time informationabout the states of devices, real-time power usage by devices, andhistorical information about device activity.

A building may also include devices known as “smart plugs.” A smart plugmay provide information about power consumption for devices that receivepower from the smart plug. A smart plug, for example, may plug into aconventional electrical outlet and allow a device to be plugged into thesmart plug. Accordingly, the device receives power via the smart plug. Asmart plug can include functionality to provide information about thepower provided to the device connected to the smart plug. For example,the smart plug may include one or more sensors that measure electricalproperties (e.g., current, voltage, or power) of the electricityprovided to the device connected to the smart plug. The sensor data maybe used to determine an amount of power consumed by the device overtime. The smart plug may also have a network connection (e.g., Wi-Fi orBluetooth) to transmit information about the power usage of theconnected device to other devices, such as a smart phone. A smart plugmay have other functionality as well. For example, a smart plug may havean electrical relay to start and stop the flow of electricity to adevice connected to the smart plug, and a user may have an app on asmart phone that allows a user to control the relay.

A power monitor may receive information from a smart plug to improve theservices provided by the power monitor. For example, a power monitor mayhave a network connection with a smart plug and receive information fromthe smart plug about the amount of power provided by the smart plug todevices connected to the smart plug.

For clarity of presentation, the techniques described herein will use ahouse or home as an example of a building where the techniques may beapplied, but the techniques described herein are equally applicable toany environment where electricity is used, including but not limited tobusinesses and commercial buildings, government buildings, and othervenues. References to homes throughout should be understood to encompasssuch other venues.

Power Monitor Environment

FIG. 1 is an example of a system 100 where power monitoring and networkmonitoring may be used to determine information about devices in a home.In FIG. 1 , electric company 120 provides electrical power to house 110.The electrical power is transmitted to an electrical panel 140 where itmay then be distributed to different electrical circuits in the house.

Electrical panel 140 may be any electrical panel that may be found in abuilding. For example, electrical panel 140 may implement split-phaseelectric power, where a 240 volt AC electrical signal is converted witha split-phase transformer to a three-wire distribution with a singleground and two mains (or phases or legs) that each provide 120 volts.Some devices in the house may use one of the two mains to obtain 120volts; other devices in the house may use the other main to obtain 120volts; and yet other devices may use both mains simultaneously to obtain240 volts.

Any type of electrical panel may be used, and the techniques describedherein are not limited to a split phase electrical panel. For example,electrical panel 140 may be single phase, two phase, or three phase. Thetechniques are also not limited to the number of mains provided byelectrical panel 140. In the discussion below, electrical panel 140 willbe described as having two mains, but any number of mains may be used,including just a single main. Other voltage standards, such as for othercountries or continents, are intended to be encompassed herein as wouldbe understood by one of ordinary skill in the art.

FIG. 1 illustrates devices that are consuming electricity provided byelectrical panel 140. For example, power monitor 150, refrigerator 160,and stove 165 may consume electricity provided via electrical panel 140.

Power monitor 150 may be connected to sensor 130 to measure electricalproperties of the electrical line connected to house 110. For example,sensor 130 may measure voltage and/or current levels for electricallines providing electricity to electrical panel 140. The measurementsmay be obtained using any available sensors, and the techniques are notlimited to any particular sensors or any particular types of values thatmay be obtained from sensors. Sensor 130 may comprise multiple sensors,such as one or more sensors for each main.

Sensor 130 may provide one or more power monitoring signals to powermonitor 150, such as a measurement of current and/or voltage for eachmain connected to electrical panel 140. Power monitor 150 may processthe power monitoring signals to disaggregate them or to obtaininformation about individual devices in the home. For example, powermonitor 150 may determine state changes of devices, such as thetelevision was turned on at 8:30 pm or the compressor of therefrigerator started at 10:35 am and 11:01 am.

Power monitor 150 may be a device that is obtained separately fromelectrical panel 140 and installed by a user or electrician to connectto electrical panel 140. Power monitor 150 may be part of electricalpanel 140 and installed by the manufacturer of electrical panel 140.Power monitor 150 may also be part of (e.g., integrated with or into) anelectrical meter, such as one provided by the electric company, andsometimes referred to as a smart meter.

Power monitor 150 may use any appropriate techniques for performingdisaggregation or determining information about the power usage or stateof individual devices from the power monitoring signal. For example,power monitor 150 may use any of the techniques described in U.S. Pat.No. 9,443,195.

Power monitor 150 may be connected to a computer network in the house.For example, power monitor 150 may have a wired connection to a routerin the house (e.g., LAN Ethernet), may have a wireless connection to anetwork (e.g., Wi-Fi), or may have direct network connections with otherdevices (e.g., Bluetooth). In these implementations, power monitor 150is also a network monitor, but for clarity of presentation, thefollowing description will continue to use the term power monitor.

FIG. 1 illustrates network connections between the power monitor andother devices in the house. In this example, power monitor 150 has anetwork connection with network device 115, which may be any device thatfacilitates a network in the house, such as a modem, router, or hub.Other devices in the house may also be connected to network device 115.For example, a television 125 (e.g., a smart television), computer 135(e.g., a personal computer), smart plug 145 (e.g., a Phillips Hue orBelkin Wemo switch), and a phone 170 (e.g., an Android phone or iPhone)may also be connected to the home network. Power monitor 150 may connectto other devices in the house using any appropriate wired or wirelessnetwork configuration, such as LAN Ethernet or direct connections withother devices. In some implementations, power monitor 150 maycommunicate on multiple networks simultaneously (e.g., a Wi-Ficonnection to a home router and a Bluetooth connection to a specificdevice).

FIG. 2 is an example of a system 200 illustrating two mains and fourcircuits of a house, such as the house of system 100. The techniquesdescribed herein, however, apply to any number of mains and circuits.

In FIG. 2 , electric company 120 is providing two electrical mains ofpower, for example a first electrical main that is 180 degrees out ofphase with a second electrical main. Power monitor 150 may have a firstsensor 231 that measures an electrical property of the first-main toobtain a first-main power monitoring signal, and a second sensor 232that measures an electrical property of the second-main to obtain asecond-main power monitoring signal.

The two mains of electrical power may be distributed to devices in thehouse over multiple electrical circuits. For example, first-main bus bar211 may distribute first-main electrical power to circuit 221 andcircuit 222, and second-main bus bar 212 may distribute second-mainelectrical power to circuit 233 and circuit 234. Various devices mayreceive power from the electrical circuits as shown in FIG. 2 . Notethat multiple devices may receive power from a single circuit, and thatsome devices may receive power using both the first-main and thesecond-main, but these configurations are not presented in FIG. 2 forclarity of presentation.

Power monitor 150 may have a network connection with smart plug 145 andreceive a smart-plug power monitoring signal from smart plug 145 thatprovides information about the power consumption of one or more devicesconnected to smart plug 145, such as device 155. Accordingly, powermonitor may receive information about the power consumption of device155 from two sources: (1) a first-main power monitoring signal obtainedvia first sensor 231 and (2) a smart-plug power monitoring signalobtained from smart plug 145.

FIGS. 3A-3C illustrate an example of a hypothetical first-main powermonitoring signal 301, second-main power monitoring signal 302, andsmart-plug power monitoring signal 303 that may be processed by powermonitor 150.

In FIG. 3A, first-main power monitoring signal 301 illustrates powerevents caused by state changes of two devices, a toaster oven and anincandescent light bulb. Both the toaster oven and the incandescentlight bulb receive power from the first electrical main of the building.In FIG. 3A, the power events labelled with HE1 correspond to a heatingelement of the toaster oven being turned on and the power eventslabelled with HE0 correspond to the heating element of the stove beingturned off (for toaster ovens, the heating element may appear to be onto the user, but the toaster oven may cause the heating element to turnon and off on a periodic basis to maintain a desired temperature). Thepower event labelled with I1 corresponds to an incandescent light bulbbeing turned on and the power event labelled I0 corresponds to theincandescent light bulb being turned off.

At power event 310, the toaster oven is turned on and the heatingelement consumes electricity. Accordingly, the power usage increases inthe first-main power monitoring signal 301. While the heating element ison, at power event 320, the incandescent light bulb is turned on tofurther increase the power usage. At power events 330, 340, 350, and360, the heating element is turned off, then on, then off, and then onagain. At power event 370, the incandescent light bulb is turned off,and at power event 380, the toaster oven is turned off and the heatingelement stops consuming electricity.

In FIG. 3B, second-main power monitoring signal 302 illustrates a powerevent 390 caused by a state change of a device that receives power fromthe second electrical main of the building. For example, power event 390may correspond to charging an electric car. Because the devices changingstates in FIGS. 3A and 3B each receive power from a single electricalmain, the power events caused by the state changes of the devices appearin only one of FIG. 3A or FIG. 3B. For a device that receives power fromboth electrical mains (e.g., an electric dryer), power events caused bystate changes of the device may appear in both FIGS. 3A and 3B.

FIG. 3C is a smart-plug power monitoring signal 303 received from asmart plug that is connected to the toaster oven of FIG. 3A.Accordingly, for each state change of the toaster oven, a power eventappears both in first-main power monitoring signal 301 and smart-plugpower monitoring signal 303.

Although the power events caused by the toaster oven appear in bothpower monitoring signals (first-main and smart plug), the power eventsmay appear differently in the two power monitoring signals. For example,the two power monitoring signals may measure different electricalproperties (e.g., current vs. voltage), may use different types ofphysical sensors that produce different readings, may be shifted ortranslated in time (e.g., due to network transmission or other delays),may be scaled differently (e.g., because of different sensor gains), ormay be digitally sampled at different sampling rates. For example, forsome smart plugs, a low sampling rate may cause the power events 330,340, 350, and 360 to not appear in smart-plug power monitoring signal303, and smart-plug power monitoring signal may have a relativelyconstant value between power event 310 and power event 380.

Power Monitoring

Power monitor 150 may process first-main power monitoring signal 301 andsecond-main power monitoring signal 302 (either may be referred to as apower monitoring signal) to identify devices and/or determine statechanges of devices. Some state changes may correspond to a personturning on or off the device and some state changes may correspond to achange in the functioning of a device (e.g., cycling of a heatingelement or washing machine changing from wash mode to a spin mode).Power monitor 150 may use any appropriate techniques for identifyingdevices and determining state changes of devices from a power monitoringsignal, such as any of the techniques described in U.S. Pat. No.9,443,195.

In some implementations, power monitor 150 may process a powermonitoring signal with mathematical models to identify devices anddetermine state changes of devices. Such models will be referred to aspower models. For example, power monitor 150 may have power models fordifferent types of devices (e.g., stove, dishwasher, refrigerator,etc.), different makes of devices (e.g., Kenmore dishwasher, Maytagdishwasher, etc.), different versions of devices (e.g., Kenmore 1000dishwasher), and specific devices (e.g., the dishwasher at 100 MainSt.). Power monitor 150 may also have power models for particular statechanges, such as a device turning on, a device turning off, or a devicechanging operation in another way (a water pump of a dishwasher turningon or off). In common usage, the “1000” in a Kenmore 1000 dishwasher maybe referred to as a “model” of the dishwasher, but to avoid confusionwith mathematical models, the “model” of a dishwasher will instead bereferred to herein as a “version.”

When processing the power monitoring signal with a power model, such asany of the power models referred to above, the power model may generatea score (e.g., a probability, likelihood, confidence, etc.) indicating amatch between the power model and the power monitoring signal. When apower event occurs in the power monitoring signal (such as any of theevents in FIGS. 3A-C), a portion of the power monitoring signal thatincludes the power event may be processed by a variety of power models,and a score may be generated by each of the power models. The powermodel scores may be used to identify devices in the home and/ordetermine state changes of devices in the home.

In some implementations, power monitoring may proceed as follows. Thepower monitoring signal may be continuously processed to identify powerevents in the power monitoring signal. A power event detection componentmay detect changes in the electrical signal that likely correspond todevice state changes and cause these portions of the power monitoringsignal to be further processed. A power event detection component may beimplemented using any appropriate techniques, such as a classifier.

After a power event is detected, a feature generation component may beused to generate features from the portion of the power monitoringsignal that includes the power event. Any appropriate features may becomputed, such as any of the features described in U.S. Pat. No.9,443,195.

The features may then be processed by one or more power models toidentify a device or determine a device state change corresponding tothe power event. Any appropriate power models may be used, such as thetransition models, device models (also referred to herein a statemodels), wattage models, and prior models described in U.S. Pat. No.9,443,195. For example, each power model may generate a score, and thedevice state change may be determined by selecting the power model withthe highest score.

Techniques for identifying devices in a home using power models are nowdescribed. In some implementations, power monitor 150 may be installedwith an initial set of power models corresponding to devices that arelikely in the house.

In some implementations, power monitor 150 may identify a device asbeing in the house if a score generated by a power model exceeds athreshold. For example, a dishwasher model may generate a score thatexceeds a threshold when a dishwasher model processes a portion of thepower monitoring signal corresponding to the dishwasher being started.The threshold may be specific to the dishwasher model or the thresholdmay be the same for all power models. In some implementations, aconfidence level may be computed in addition to or instead of the score,and a device will be identified when the confidence level exceeds athreshold.

In some implementations, additional criteria may be considered beforeidentifying a device. For example, power monitor 150 may have multipledishwasher power models corresponding to different types of dishwashers(e.g., regular dishwashers and energy efficient dishwashers) or theremay be power models for different makes of dishwashers. When processingthe power monitoring signal corresponding to the dishwasher starting,multiple dishwasher models may produce a score (or confidence level)that exceeds the threshold. Instead of identifying multiple dishwashers,a single dishwasher may be identified corresponding to the highestscoring model that exceeds the threshold. For example, power monitor 150may have a power model for Kenmore dishwashers and Bosch dishwashers.Each model may generate a score that exceeds the threshold, but thescore of the Kenmore model may be higher than the score for the Boschmodel. Accordingly, a Kenmore dishwasher may be identified.

In some implementations, power monitor 150 may be updated withadditional power models after a device has been identified. For example,after it has been determined that the house has a dishwasher, powermodels may be added to power monitor 150 corresponding to the mostcommon makes of dishwashers. The power monitoring signal may then beprocessed with the power models for different makes of dishwashers, anda highest scoring power model may be used to identify the make of thedishwasher in the house. This process may be repeated to determineadditional information, such as a version of the dishwasher (e.g.,Kenmore 1000 dishwasher).

After devices in the house have been identified, power monitor 150 mayprocess the power monitoring signal to determine state changes of theidentified devices. In addition to having power models for particulardevices, power monitor 150 may also have models for particular statechanges of devices, and these models may be used to determine when adevice changes state.

As described above, power models for state changes of devices may beused to process a power monitoring signal to generate scores for thepossible state changes. Where a score (or confidence level) exceeds athreshold, power monitor 150 may determine that the state changecorresponding to the model has occurred. For example, power monitor 150may have power models for the dishwasher starting operation andfinishing operation. When the power model for the dishwasher startinggenerates a score that exceeds a threshold, power monitor 150 maydetermine that the dishwasher has started. Similarly, when the powermodel for the dishwasher ending generates a score that exceeds athreshold, power monitor 150 may determine that the dishwasher hasfinished its cycle.

The power models for determining state changes need not be the same asthe power models for identifying devices, and the thresholds used fordetermining state changes need not be the same as the thresholds usedfor identifying devices. The models and thresholds may be adjusted toobtain desired tradeoffs for accuracy and error rates.

Aspects of the operations described above for identifying devices anddetermining state changes of devices may be performed by other computersinstead of power monitor 150 (e.g., a server computer operating inconjunction with a power monitor). For example, in some implementations,power monitor 150 may provide a power monitoring signal to anothercomputer (e.g., a server) and the other computer may identify devicesand state changes. In some implementations, the other computer mayidentify devices, and power monitor 150 may determine state changes ofdevices.

Network Monitoring

In some implementations, power monitor 150 may be connected to acomputer network in the house. For example, power monitor 150 may have awired connection to a router in the house (e.g., LAN Ethernet), may havea wireless connection to a network (e.g., Wi-Fi), or may have directnetwork connections with other devices (e.g., Bluetooth). In theseimplementations, power monitor 150 is also a network monitor, but forclarity of presentation, the following description will continue to usethe term power monitor. Power monitor 150 may use any appropriatetechniques for identifying devices and determining state changes ofdevices from network data, such as any of the techniques described inU.S. Pat. No. 9,699,529.

Power monitor 150 may learn about devices in the house using datatransmitted over the computer network. For example, power monitor 150may listen for broadcast messages from other devices, may poll otherdevices, or may listen for network data generated by other devices. Insome implementations, power monitor 150 may learn about other devices inthe house indirectly via networks outside of the house. For example, adevice in the house may transmit information to a third-party serverthat operates in conjunction with that device, and the third-partyserver may transmit information to a server that operates in conjunctionwith power monitor 150. Each of these techniques may be used to identifydevices in the house and determine state changes of the devices (e.g.,that the device is on or off).

In some implementations, a device in the house may transmit data thatincludes information about the device itself (e.g., a broadcast messageor response to poll). For example, a network transmission may includeany of the following: a state (e.g., device just turned on or will beturning off), services offered by the device, a user assigned name(e.g., “John's Mac”), a make, a hardware version, a software version, anetwork address (e.g., an IP address), an identification number (e.g., aMAC address, a device serial number, a universally unique identifier, aglobally unique identifier, or a temporary identifier), or otherinformation (e.g., protocol-specific identification (such as a Zeroconfservice name) or a resource locator used with the SSDP protocol).

Power monitor 150 may learn information about another device bylistening for broadcast messages from the other device (a broadcastingdevice). Some devices may be configured to broadcast information acrossa network to announce services or capabilities offered by the device toother devices on the network. For example, a television may provide aservice to allow other devices (e.g., phones or personal computers) tostream video content to the television for the television to display,and the television may broadcast a message to the network so that otherdevices know that this service is available.

Information from the broadcast messages may be used to identify devicesin the house. For example, the messages may include data that may beused to identify the device, such as text describing the device or anidentifier. Information from the broadcast messages may also be used todetermine the state of the device. For example, announcing theavailability of a service may indicate that the device is on andannouncing withdrawal of a service may indicate that the device is off.In some implementations, a broadcast message may provide someinformation about the device, and upon receiving the broadcast message,power monitor 150, may poll the device to obtain additional informationabout the state of the device. For example, a network speaker system maybroadcast that services are available, and power monitor 150 may thenpoll the network speaker system to find out that it is currently playingmusic and information about the music being played (e.g., song title,volume, etc.)

Power monitor 150 may learn information about another device usingpolling techniques. Any appropriate polling techniques may be used topoll a device. In some implementations, the broadcasting techniquesdescribed above may also allow for polling. For example, SSDP may allowa device to poll other devices on the network to determine what servicesthose devices provide, and those devices may respond with messagessimilar to the broadcast messages described above. In someimplementations, lower-level protocol polling may be used, such asinternet control message protocol (ICMP) pings or address resolutionprotocol (ARP) pings.

Information from poll responses may be used to identify devices in thehouse. For example, poll responses may include data that may be used toidentify the device, such as text describing the device or anidentifier. Poll responses may also be used to determine the state ofthe device. For example, a lack of a response to a poll request mayindicate that the device is off, a response may indicate that the deviceis on, and information in the response may provide additionalinformation (e.g., a song that is being played).

Power monitor 150 may learn information about another device bymonitoring network data sent by the device to other devices. In someimplementations, individual device monitoring may only be used with anexplicit opt in by a user or may use only a network packet header (andnot the packet body) to avoid collecting too much information or avoidcollecting sensitive information. Power monitor 150 may passivelyreceive this network data on the network, such as by passively receivingnetwork packets.

Power monitor 150 may process the received data to determine informationabout the monitored device. Information in the received data may be usedto identify the device, such as text describing the device or anidentifier. The received data may also be used to determine the state ofthe device. For example, the fact that the device is transmitting dataindicates that the device is on, and if the device does not transmit anydata over a period of time, it may be determined that the device is off.

In some implementations, power monitor 150 may have information aboutpublicly available APIs for third-party devices and use these APIs todetermine whether such third-party devices are present in the house. Forexample, power monitor 150 may periodically send out a request using theNest thermostat API to determine if a Nest thermostat is present in thehouse. After it is determined that a Nest thermostat is in the house, itmay be polled more frequently to determine the state of the Nestthermostat or the state of the heating/cooling system. The APIs mayallow, for example, other devices to determine the temperature of thehouse, a desired temperature set by a user, or a state of the heatingsystem or cooling system (e.g., whether the furnace is currently activeor start and stop times of furnace activity). Querying a device with aspecialized API may allow power monitor 150 to determine the state ofthe device itself (e.g., the Nest thermostat) and other devices that areconnected to it (e.g., the furnace).

In some implementations, power monitor 150 may subscribe tonotifications transmitted by third-party devices, which are referred toherein as notifying devices. A notifying device may be configured totransmit notifications to other devices (e.g., periodically or upon astate change) and allow other devices to sign up to receive thenotifications using an API. Power monitor 150 may determine that anotifying device is in the house and then subscribe to receivenotifications from the device. Power monitor 150 may transmit requeststo receive notifications from notifying devices without knowing that thenotifying devices are present, and where the notifying devices arepresent, be subscribed to receive notifications. Some notifying devicesmay have a pairing procedure that requires assistance of a user, andpower monitor 150 may be configured to receive input from a user toassist with the pairing process, such as receiving a user name andpassword to pair with the notifying device.

Other third-party devices may also provide information about devicesthey are connected to or that they control, such as a smart switch 340or a smart light bulb (e.g., Phillips Hue or Belkin Wemo). A smartswitch may have an API to allow other devices to interact with it, andpower monitor 150 may use this API to determine a state of the switch,and accordingly whether the device connected to the smart switch isconsuming power (e.g., the device is on, the device is off, or adimmer-type switch is at 40%). Other examples include a smart thermostatthat controls a heating or cooling system and may transmit networkpackets including information about the state of the heating or coolingsystem; a device that controls lights (e.g., LED lights) and maytransmit network packets including information about the state of thelights; a device that controls speakers and may transmit network packetsincluding information about the state of the speakers; a networkconnected plug that controls the flow of power to the device connectedto the plug and may transmit network packets including information aboutwhether the flow of power is enabled to the connected device or not; ora car charger that charges an electric car and may transmit networkpackets including information about the amount of power being consumedby the car.

In some implementations, power monitor 150 may receive information abouta device in the house via a server external to the house, such as athird-party server that operates in conjunction with a third-partydevice in the house. Power monitor 150 may operate in conjunction with apower monitor server, and the third-party device in the house mayoperate in conjunction with the third-party server. For example, a Nestthermostat may send information about the state of the thermostat or theheating/cooling system of the house to a server operated by Nest. Thethird-party server may allow a user to provide configuration informationto cause the third-party server to transmit information to the powermonitor server using, for an example, an API of the power monitor serveror the third-party server. For example, the Nest server may transmitinformation received from the Nest thermostat in the house to the powermonitor server, such as on a periodic basis or when a state of thethermostat changes (or the state of the heating/cooling system changes).In some implementations, the power monitor server may send requests tothe third-party server for information about the third-party deviceinstead of receiving notifications from the third-party server. In someimplementations, the third-party device may communicate directly withthe power monitor server, or power monitor 150 may communicate directlywith the third-party server.

In some implementations, information received in a network transmissionfrom a device may be used to obtain further information about thedevice. For example, network transmissions may include a uniqueidentifier, such as a media access control (MAC) address. A uniqueidentifier may be used to determine additional information about thedevice using a data store or repository of information about devicesthat use the unique identifier. A data store may provide informationabout the type, make and/or version of the device based on the uniqueidentifier. For example, for MAC addresses, blocks of continuous MACaddresses may be specific to a type of device (e.g., television),manufacturer, or a version of the device (e.g., a particular model of atelevision). In some implementations, a data store of MAC addressinformation may be available, such as through a third-party service, andinformation about the device may be obtained using the MAC address. Adata store of identifiers may be created, purchased, or accessed (e.g.,using a third-party server) to obtain information about the device fromthe identifier.

In some implementations, user devices, such as a smartphone, may be usedto determine information about devices in the house, and the smart phonemay relay this information to power monitor 150. For example, a speaker(e.g., a portable Bluetooth speaker) may not have a network connectionwith network device 115 and may instead use another network, such as aBluetooth network, to communicate with other devices. The speaker may betoo far from power monitor 150 such that power monitor may not be ableto detect the network of the speaker. A user device, such as phone 170,may be brought into the same room as the speaker, and phone 170 may beable to determine that the speaker is present and/or an operating stateof the speaker using a direct network connection. Phone 170 may thenrelay information about the presence and/or operating state of thespeaker to power monitor 150 or to a server that works in conjunctionwith power monitor 150.

In some implementations, network models may be used to identify devicesor determine states of devices by processing network data. A networkmodel may include any appropriate mathematical models, such asclassifiers, neural networks, self-organizing maps, support vectormachines, decision trees, random forests, logistic regression, Bayesianmodels, linear and nonlinear regression, and Gaussian mixture models. Anetwork model may receive as input data obtained from networktransmissions and output identifications of devices or device statechanges with an optional score. For example, a network model couldreceive a broadcast message, information about poll responses receivedfrom the device (or lack thereof), or information about network datagenerated by that device. In some implementations, the network model mayreceive only headers of network transmissions or may receive all datafrom the network transmissions.

In some implementations, a network model may be used to identify adevice or determine a state of a device using messages broadcast by thedevice. For example, a device may transmit a certain number and/or typeof messages before it turns off and a different number and/or type ofmessages when going into a sleep mode. A first network model may becreated for describing expected messages when a device is about to turnoff and a second network model may be created for describing expectedmessages when a device is about to go into sleep mode. When receivingbroadcast messages from the device, the messages may be processed withboth network models to generate a score for each network model, and thestate transition may be determined by the highest scoring network model.

Network models may also be created to describe other aspects of thenetwork transmissions described above. For example, network models maybe created to describe how often a device responds to a poll request andan expected time delay between transmitting the poll request andreceiving the response. In another example, a network model may becreated that describes expected network transmissions of a device in aparticular state, and this network model may be applied when passivelymonitoring network transmissions of a device.

In some implementations, a rules-based approach may be used to identifydevices in the house or determine the states of devices. Power monitor150 (or a server operating in conjunction with the power monitor) mayhave rules that have been created for identifying types of devices,makes of devices, or versions of device; rules for determining statechanges of devices; and rules for determining other aspects of devices.Rules may be created for any of the techniques described above, such asprocessing broadcast messages from a device, polling a device, ormonitoring network data generated by a device.

Some rules may output a boolean value to indicate whether the conditionsof the rule are met or not. For example, a rule may be created todetermine whether the device that transmitted the network data is atelevision, and if the conditions of the rule are satisfied, it isdetermined that the device is a television. Some rules may output ascore, for example, on a scale of 1 to 100, to indicate a match betweenthe network data and the rule. For example, a rule may be created todetermine whether the device that transmitted the network data is atelevision, and a score produced by the rule may be used to make thedetermination, such as by comparing the score to a threshold orcombining the score with other scores as described herein.

Multiple rules may exist for making a determination. For example,multiple rules may exist for determining whether the device thattransmitted the network data is a television, and if any one of therules is satisfied, it may be determined that the device is atelevision.

Any data in a network transmission or data relating to a networktransmission may be used as input into a rule. For example, informationextracted from a network transmission (such as a network address, anidentifier, a header, a string) may be used as input into a rule.Information that is not in the network transmission but is related tothe network transmission may also be used, such as a time that thenetwork transmission was received.

In some implementations, a rule may comprise one or more conditions thatneed to be satisfied for the rule to be met. For example, a conditionmay include any comparison of data, such as inequality, equality,greater than or less than. Rules may employ any combinations ofconditions, including but not limited to combinations using Booleanalgebra. Examples of rules include the following: a device thatbroadcasts Zeroconf services including AFP, HTTP, and SSH is an AppleMac OS computer; structured data returned as part of a NetBIOS STATUSpoll request provides a user-visible name of a host; a device with apreviously-unseen MAC address making a DHCP request is a new devicejoining the network for the first time; and the vendor of a device isdetermined using known MAC address vendor prefixes.

In some implementations, device fingerprinting techniques may be used toidentify devices on the network. Device fingerprints may be created forknown devices, such as a Mac computers, Windows computers, and Linuxcomputers, and possibly different operating system versions of each. Afingerprint may be created by sending multiple requests to each deviceusing, for example, different protocols and port numbers (e.g., using aprogram such as Nmap). The responses of each device may be recorded tocreate a fingerprint for each device. Any appropriate data may be usedwhen creating device fingerprints, such as the number and types ofnetwork protocols broadcast by the device, broadcast behavior, number orfrequency of different types of broadcasts, or parameters used fornetwork transmissions (e.g., a TCP window size).

For an unknown device in the house, similar requests may be sent to thatdevice and the responses may be used to create a fingerprint for theunknown device. The fingerprint for the unknown device may be comparedwith the fingerprints for known devices to determine information aboutthe unknown device. For example, if the fingerprint of the unknowndevice has a closest match with the fingerprint for a Mac laptop, thenthe unknown device may be identified as a Mac laptop. In someimplementations, address resolution protocol (ARP) may be used toidentify devices on the network and then each of the identified devicesmay be fingerprinted using the techniques described above.

Any of the techniques described above for identifying devices ordetermining device states using network data may generate a scoreindicating a match between the data and the identified device or statechange. For example, applying a rule to a broadcast message may resultin a determination that the device is a Toshiba television with a scoreof 80% or a Sony television with a score of 60%. The scores generated bynetwork models may be combined with scores generated by power models asdescribed in greater detail below.

Combined Power and Network Monitoring

FIG. 4 illustrates a system 400 for providing users with informationabout devices in their home using one or both of power monitoring andnetwork monitoring. In FIG. 4 , power monitor 150 may have any of thefunctionality described above. For example, power monitor 150, mayidentify the existence of devices in the house, may determine states ofdevices in the house, and may determine power consumption of devices inthe house. Power monitor 150 may transmit the information about devicesin the home to servers 410 using any known networking techniques. Forexample, power monitor may have a wireless connection to a router, whichin turn connects to servers 410.

Servers 410 may process the information received from power monitor 150and present information to users, such as through user device 440.Servers 410 may maintain a device list for devices in the home andupdate the device list with newly identified devices or updated statesof devices. Servers 410 may further record a log of device statechanges, record a history of power consumption of the house andindividual devices, and perform any of the other operations described inU.S. Pat. No. 9,443,195. For performing some operations, servers 410 mayaccess other resources, such as third-party servers 430 and a deviceinformation data store 420.

A user may obtain information about devices in the house using userdevice 440. User device 440 may be any device that provides informationto a user including but not limited to phones, tablets, desktopcomputers, and wearable devices. User device 440 may present, forexample, information about device state changes and real-time powerusage to the user. For example, user device 440 may present a web pageto the user or a special-purpose app may be installed on user device440. The information presented by user device 440 may include any of theinformation described in U.S. Pat. No. 9,443,195.

To provide information to users about devices in a home, a list ofdevices in the home may be maintained. FIG. 5 illustrates an exampledevice list 500. The list of devices may include any informationrelating to devices in the home, including but not limited to a deviceID (which may be particular to the home or all devices known by acompany providing the service), a name (e.g., a user supplied name), atype, a make, a version, one or more power models that are used toidentify state changes of the device, a network ID (e.g., a networkaddress or other identifier, such as a MAC address), one or more networkmodels that are used to identify state changes of the device, the mainthat provides power to the device (e.g., first, second, both, or either(e.g., for portable devices that may be plugged in to differentelectrical outlets)), an identifier of a smart plug that the device isconnected to (or an indicator that the device is not connected to asmart plug), and a state of the device.

Device list 500 may be stored in one or more locations. For example,device list 500 may be stored at one or more of power monitor 150,servers 410, device information data store 420, or user device 440.Different versions of the device list may be stored in differentlocations corresponding to the processing at the location. For example,power monitor 150 may not store the name, type, make, or version of thedevices because this information may not be needed to determine devicestate changes. User device 440 may not store information about powermodels and network models because user device 440 may not determine anydevice state changes.

In FIG. 1 , power monitor 150 may process one or more power monitoringsignals and network data to identify devices in the home and to identifystate changes of devices in the home. Power monitor 150 may receive oneor more power monitoring signals from sensor 130 that measures anelectrical property of power provided to house 110. Power monitor 150 isalso connected to the network in house 110 via network device 115. Powermonitor 150 may receive network data from other devices via networkdevice 115 (as indicated by the dotted lines) or may receive networkdata directly from other devices (not shown in FIG. 1 ).

For some devices in the home, either one or both of power monitoring andnetwork monitoring may be inaccurate or have higher error rates thandesired when identifying devices or state changes of devices. By usingboth power monitoring and network monitoring cooperatively orsimultaneously, the performance of identifying devices or state changesof devices may be improved. Simultaneous power monitoring and networkmonitoring may be implemented using any appropriate techniques, asdescribed in greater detail below, such as combining scores, rules, orvoting techniques.

In some implementations, the operations of power monitor 150 may changedepending on whether a user is interacting with user device 440 to viewinformation about devices in the house. Where a user is viewinginformation about devices in the home using user device 440, it may bedesired to identify new devices or state changes of devices more quicklythan when no users are viewing information about devices in the home.

When a user starts viewing information about devices in the home withuser device 440, user device 440 may establish a network connection toservers 410, and servers 410 may transmit information about devices touser device 440. Servers 410 may also have a network connection (eitherdirect or indirect) with power monitor 150. Accordingly, servers 410 maytransmit information to power monitor 150 to cause the operations ofpower monitor 150 to change. Any operations of power monitor 150 may bechanged to improve the user experience for the end user. In someimplementations, power monitor 150 may change its operations to identifynew devices and state changes of new devices more quickly. For example,power monitor may increase a polling frequency used to poll otherdevices in the house. Where no users are viewing information aboutdevices, a polling frequency of 5 minutes may be sufficient to determineupdates. When a user starts viewing information about devices, thepolling frequency may be increased (e.g., 10 seconds) to more quicklydetermine updates.

The arrangement and specific functions of the components of FIG. 1 andFIG. 2 provide just one example of how the techniques described hereinmay be implemented, but other configurations are possible. For example,power monitor 150 may perform some or all the operations of servers 410,and power monitor 150 may directly provide information to user device440. In another example, power monitor 150 may include some or all ofthe functionality of user device 440, and a user may interact directlywith power monitor 150 to obtain information about device events andpower consumption.

Identifying Devices

When power monitor 150 is first installed in a home, a device list maybe created for devices in the home. In some implementations, an emptydevice list may be created. In some implementations, a device list maybe initialized with devices based on input from one or more people inthe home. For example, a user may specify any of the types, makes,and/or versions of devices in the house.

Power monitor 150 may use one or both of power monitoring and networkmonitoring to add or update devices in the device list using any of thetechniques described herein. Devices may be added to the device listafter they are identified by power monitor, and devices on the devicelist may be further updated as additional information about them isdetermined. For example, power monitor 150 may initially determine thatthe house has a dishwasher, and it may later determine that the househas a Kenmore 1000 dishwasher.

In some implementations, power monitor 150 may add multiple devices tothe device list in response to processing a power event in the powermonitoring signal. For example, if two power models produce a scoreabove a threshold, then devices corresponding to each power model may beadded to the device list. In some implementations, the scores producedby the power models may be included in the device list as well.

Power monitor 150 may also process network data to identify devices inthe house and add them to the device list. For example, power monitor150 may use any of the techniques described above to obtain informationabout devices connected to a network in the house, and then add devicesto the device list for the house.

In some implementations, power monitor 150 may add multiple devices tothe device list (optionally with scores) in response to processing anetwork data transmission. For example, in response to processing abroadcast message, a Toshiba television may be added to the device listwith a first score and a Sony television may be added to the device listwith a second score.

Scores for devices on the device list may be updated over time. Forexample, processing a first power event may cause a first device and asecond device to be added to the device list with corresponding scores.At a later time, power monitor 150 may process a second power event togenerate a second set of scores for the first and second devices. Thesecond set of scores generated using the second power event may be usedto update the overall scores for the first and second devices on thedevice list.

Similarly, network data transmissions at later times may be used toupdate a score for a device on a device list. For example, a first andsecond device may be added to a device list with corresponding scoresbased on processing a first network transmission. At a later time, powermonitor 150 may process a second network transmission and generatesecond scores for the first and second devices. As above, the second setof scores generated using the second network transmission may be used toupdate the overall scores for the first and second devices on the devicelist.

In some implementations, a device on a device list may have a score thatis generated using both power monitoring and network monitoring. A firstdevice may be added to the device list with a corresponding score afterprocessing a power event. Later, the score for the first device may beupdated by processing a first network transmission. An overall score fora device on the device list may be generated by any combination ofprocessing power events and network transmission events.

Scores may be combined using any appropriate techniques. In someimplementations, an overall score for a device may be an average of allindividual scores generated for that device. In some implementations, avariance may be determined for each of the scores, and the scores may benormalized (e.g., Z-scored) before being combined.

In some implementations, power monitor may simultaneously use both powermonitor monitoring and network monitoring to identify devices. For adevice that is connected to the electrical line and has a networkconnection, the device may, around the time of a state change, cause apower event in the power monitoring signal and transmit data over thenetwork (a network event). Power monitor 150 may simultaneously processboth the power event and the network event to identify the device.

The power event and network event may appear in either order. Forexample, a power event may correspond to the television being turned on,and afterwards a network event may correspond to a broadcast message bythe television announcing the availability of services. For anotherexample, a user may turn off the television and a network event may be abroadcast message withdrawing services, and afterwards a power event maycorrespond to the television turning off.

When processing a power event, power monitor 150 may look for networkevents that are temporally close to the power event (e.g., within a timeinterval, such as within 1 second) and process them simultaneously. Forexample, power monitor 150 may process network events where thedifference between the time of the power event and the time of thenetwork event is less than a threshold. Similarly, when processing anetwork event, power monitor 150 may look for power events that aretemporally close to network event.

In some implementations, power monitor 150 may process a power event andgenerate scores for corresponding power models. Power monitor 150 maythen look for network events that are temporally close to the powerevent and use information from the network event to adjust the scoresgenerated by the power models. For example, the top two scoring powermodels may be for a Toshiba television and a Sony television and thescores may be close to each other. A network event may occur shortlyafter the power event, and the network event may correspond to a Toshibatelevision. Power monitor 150 may use the network event to increase thescore for identifying a Toshiba television and then identify a Toshibatelevision and add it to the device list.

A time difference between a power event and a network event may also beused to identify devices. A device may send out a network event with aconsistent delay after causing a power event or vice versa. For example,a television turning on may consistently send out a network event (e.g.,broadcasting services) at about 3.5 seconds after causing a power event.The timing of the power events and network events may be a feature thatmay be used with any of the identification techniques described herein.

In some implementations, device identification models may be used thatreceive both information about a power event and information about anetwork event as input and then generate scores indicating a matchbetween the input and a device. For example, a device identificationmodel may be created for a type of device, a make of a device, or aversion of a device. In some implementations, power monitor 150 maycompute a score for each device identification model, select a deviceidentification model having a highest score, and identify the deviceusing the highest scoring device identification model. Deviceidentification models may be created using any appropriateclassification techniques, such as neural networks, self-organizingmaps, support vector machines, decision trees, random forests, logisticregression, Bayesian models, linear and nonlinear regression, andGaussian mixture models.

In some implementations, confidence levels may be computed in additionto scores, and the confidence levels may be used in determining whetherto add a device to the device list or update information about a devicein the device list. For example, where only one score is above athreshold and the score is much higher than all of the other scores,then the confidence level may be high. Where multiple scores are abovethe threshold, no scores are above the threshold, or the highest scoreis close to the second highest score, then the confidence may be low.Any appropriate techniques may be used to determine a confidence levelfor the highest scoring device state change. Where a highest scoringmodel (e.g., power model, network model, or device identification model)has a low confidence level, the device list may not be updated.

Devices may also be removed from the device list. For example, a usermay review the device list and remove devices that are not present inthe house. Devices may also be removed from the device listautomatically. For example, a device may be removed if it hasn't beenidentified for longer than a threshold period of time, if an overallscore for the device falls below a threshold, or sufficient data hasbeen obtained to distinguish the device from alternative devices (e.g.,enough data has been collected to determine with confidence that thetelevision is a Toshiba television and not a Sony Television).

The techniques described above use a combination of power monitoring andnetwork monitoring to provide improved identification of devices in abuilding over techniques based on only power monitoring. With only powermonitoring, some devices may not be able to be identified at all or maybe identified but with a lower accuracy. The combination of networkmonitoring with power monitoring allows a greater number of devices tobe identified (such as networked devices without mechanical components)and devices may also be identified with greater accuracy. Usinginformation from both power monitoring and network monitoring allows forthe creation of models and/or classifiers with a lower error rate thanmodels and/or classifiers that use only information from powermonitoring.

Identifying Device State Changes

In addition to identifying devices in the house, power monitor 150 mayalso determine the states of devices in the house using one or both ofpower monitoring and network monitoring. Some devices (e.g., lightbulbs) may only have two states, on and off. Other devices may havemultiple states. For example, a clothes washer may have a wash cycle, arinse cycle, and a spin cycle. A television may have an on state, an offstate, and a sleep state.

Power monitoring may be used to identify state changes using any of thetechniques described herein and in U.S. Pat. No. 9,443,195. For example,power monitor 150 may process the power monitoring signal, select apower model that produced a highest score, determine the device statechange from the model, and update the state of the device in the devicelist.

Network monitoring may also be used to identify state changes using anyof the techniques described herein. For example, power monitor mayprocess broadcast messages, poll devices, and monitor device networkdata to determine the states of devices from their network data asdescribed above.

In some implementations, power monitor may simultaneously use both powermonitoring and network monitoring to identify device state changes. Fora device that is connected to both the electrical line and a networkconnection, the device may, around the time of a state change, cause apower event in the power monitoring signal and transmit data over thenetwork (a network event). Power monitor may process both the powerevent and the network event to identify the state change. The powerevent and network event may appear in either order as described above.

As above, when processing a power event, power monitor may look fornetwork events that are temporally close to the power event and processthem simultaneously. For example, power monitor may process networkevents where the difference between the time of the power event and thetime of the network event is less than a threshold. Similarly, whenprocessing a network event, power monitor may look for power events thatare temporally close to network event.

In some implementations, power monitor may process a power event andgenerate scores for corresponding power models. Power monitor may thenlook for network events that are temporally close to the power event anduse information from the network event to adjust the scores generated bythe power models. For example, the top two scoring power models may be aToshiba television turning on and a computer turning on and the scoresmay be close to each other. A network event may occur shortly after thepower event, and the network event may correspond to a Toshibatelevision turning on. Power monitor may use the network event may toincrease the score for the Toshiba television turning on. For example,the score may be increased by a fixed amount, a percentage, or may becombined with a score generated by the network event processing togenerate an overall score for the device state change. Power monitor maythen identify the state change as corresponding to the Toshibatelevision turning on. The timing of power events and network events mayalso be used as a feature for any of the techniques described herein fordetermining device state changes.

For some devices, the timing between a device state change and networkevents may not be precisely known. For example, in some implementations,it may be determined that a device is off when the device has nottransmitted any network data for a period of time. It may thus bedetermined that the device turned off sometime after its last networktransmission, but the time it was turned off may not be known. In someimplementations, power monitor may process network events to determine atime varying score. For example, where a device's last networktransmission was at a first time, power monitor may output a higherscore for the time period shortly after the first time and a lower scorefor later times, such as a score with an exponential decay.

Some devices may have a known rebroadcast window, where the device willrebroadcast at set time intervals the services provided by the device.Where the device has sent out a broadcast, but the device has not sentout another broadcast within the rebroadcast window, it may bedetermined that the device has been turned off.

In some implementations, state change models may be used that receiveboth information about a power event and information about a networkevent as input and then generate scores indicating a match between theinput and a device state change. For example, a state change model maybe created for each state change of a device (e.g., state changes for atype of device, a make of a device, or a version of a device). In someimplementations, power monitor may compute a score for each state changemodel, select a state change model having a highest score, and identifythe state change using the highest scoring state change model. Statechange models may be created using any appropriate classificationtechniques, such as neural networks, self-organizing maps, supportvector machines, decision trees, random forests, logistic regression,Bayesian models, linear and nonlinear regression, and Gaussian mixturemodels.

As above, confidence levels may be computed in addition to scores, andthe confidence levels may be used in determining whether a state changehas occurred. Where a highest scoring model (e.g., power model, networkmodel, or state change model) has a low confidence level, the statechange may not be identified.

In determining device state changes, power monitor 150 may use a list ofknown states of devices and possible transitions between the states ofdevices. For example, a television may have three states: an on state,an off state, and a sleep state. Because of how the television operates,however, not all state transitions may be possible. For the threestates, there are six possible state transitions (on to off, on tosleep, off to on, off to sleep, sleep to on, and sleep to off). From the“off” state, it may only be possible to transition to the “on” state(off to sleep is not possible). From the “sleep” state, it may only bepossible to transition to the “on” state (sleep to off is not possible).Accordingly, power monitor may implement techniques (e.g., models orrules) for recognizing all of the possible state changes of devices.When determining a state change of a device, power monitor may select astate change from a list of possible state changes of the device, andthe current state may be determined from the ending state of the statechange (e.g., when selecting an off to on state change, it is determinedthat the device is now on). When determining a state of a device, powermonitor may select a state from a list of possible states of the device.Power monitor may select state changes or states depending on theimplementation and/or the device being monitored.

Any of the techniques described above for identifying devices may alsobe used for determining state changes of devices. Similarly, any of thetechniques described for determining state changes of devices may alsobe used to identify devices.

The techniques described above use a combination of power monitoring andnetwork monitoring to provide improved identification of device statechanges in a building over techniques based on only power monitoring.With only power monitoring, some device state changes may not be able tobe identified at all or may be identified but with a lower accuracy. Thecombination of network monitoring with power monitoring allows a greaternumber of device state changes to be identified (such as state changesof networked devices without mechanical components) and device statechanges may also be identified with greater accuracy. Using informationfrom both power monitoring and network monitoring allows for thecreation of models and/or classifiers with a lower error rate thanmodels and/or classifiers that use only information from powermonitoring.

Smart-Plug Power Monitoring

A smart plug in the house may provide power to one or more devices thatreceive power from the smart plug, such as smart plug 145 of FIG. 1 andFIG. 2 . A smart plug may have a single receptacle that allows a singledevice to be plugged into the smart plug or may have multiplereceptacles that allow multiple devices to be plugged into the smartplug (which may be referred to as a smart power strip). Where a smartplug has a single receptacle, a conventional power strip may be pluggedinto the smart plug to allow multiple devices to receive power from thesmart plug. A smart plug may also be combined with a conventionalelectrical outlet so that the smart plug is directly wired to theelectrical system of the house.

As used herein, a smart plug is a device that receives electrical powerfrom a circuit of a building (e.g., circuit 222 of FIG. 2 ), providespower to one or more other devices (connected devices), has a sensor tomeasure information about power transmitted to the one or more connecteddevices, and has a network connection (wired or wireless) to transmitinformation about measured power to other devices, such as a powermonitor. A smart plug may also provide other functionality, such asallowing a user to effectively turn off connected devices by opening arelay in the smart plug.

Smart plugs in a house provide additional information about powerconsumption of devices that may be used to improve the operation of apower monitor. Because a smart plug provides information about a subsetof devices in the house, it may be more effective to use informationreceived from the smart plug (such as a smart-plug power monitoringsignal) to determine information about the devices connected to thesmart plug (as compared to a main power monitoring signal that includesinformation about a larger number of devices). For some smart plugs,however, the information provided by the smart plug may be less detailed(e.g., with a lower sampling rate) and/or less accurate than the mainpower monitoring signal obtained by the power monitor. Accordingly,there may be advantages to using both information from a smart plug andinformation from an electrical main.

A power monitor may obtain information from the smart plug using anyappropriate network connections and techniques. For example, a powermonitor may establish a direct network connection with a smart plug(e.g., using Bluetooth or Wi-Fi direct) or may connect via a local areanetwork of the house. In some implementations, a power monitor mayreceive information from the smart plug via a server computer externalto the house. For example, the smart plug may send information to aserver computer and the server computer may transmit the information tothe power monitor. The server may be operated by the company thatprovides the power monitor or the company that provides the smart plug.In some implementations, a smart plug may send information to a smartplug server operated by the company that provides the smart plug, andthe smart plug server may transmit the information to a power monitorserver operated by the company the provides the power monitor. The powermonitor server may perform the necessary processing on the informationreceived from the smart plug or transmit the information to the powermonitor for processing.

Comparing Power Events and Power Monitoring Signals

The techniques described herein may compare a main power monitoringsignal (e.g., a first-main or second-main power monitoring signal) to asmart-plug power monitoring signal (where the smart plug receives powerfrom that main). For example, where a power event appears in a mainpower monitoring signal, it may be desired to know whether that mainpower event is a match to a power event in the smart-plug powermonitoring signal. Where the two power events are a match, then it canbe determined that the main power event was likely caused by a devicethat receives power from the smart plug. Where the two power events arenot a match, then it may be determined that the main power event waslikely caused by a device that does not receive power from the smartplug.

A main power monitoring signal may be compared with a smart-plug powermonitoring signal by comparing portions of the respective powermonitoring signals. For example, a Euclidean distance (a sum of squaresof a difference between the two power monitoring signals), a cosinesimilarity, or any other appropriate comparison may be used.

In some implementations, a smart-plug portion or a main portion may bemodified before performing a comparison. Where the two portions beingcompared have different sampling rates, a portion may be resampled tomatch the sampling rate of the other portion. For example, a mainportion may have a higher sampling rate than a smart-plug portion, andthe main portion may be down sampled to the sampling rate of thesmart-plug portion. One or both portions may be scaled using anappropriate metric. For example, one or both portions may be modified sothat each portion has the same L2 norm. One or both portions may betranslated in time to obtain a more accurate comparison. For example, atime translation may be determined to maximize the similarity betweenthe portions (e.g., determining a translation by performing aconvolution of the portions), and the comparison may be made using thistime translation.

In some implementations, a comparison may be computed using baselinevalues of the smart-plug power monitoring signal and/or the main powermonitoring signal. The main power monitoring signal may indicate thepower consumption of many devices in the house that are not connected tothe smart plug and thus include values that may not be directlycomparable to the smart plug. To obtain an improved comparison, abaseline power consumption for a main may be computed as an amount ofpower in the main power monitoring signal at a time before a powerevent. For example, the baseline power consumption for a main may be thepower value at a point in time prior to the power event (e.g., threeseconds) or may be an average amount (or any other appropriatestatistic, such as median or mode) of power consumption during a windowof time prior to the power event (e.g., 3-13 seconds before the powerevent). When comparing a smart-portion with a main portion, the mainportion may be normalized by subtracting the baseline of the main fromeach power value of the main portion. A comparison may then be performedbetween the smart-plug portion and the normalized main portion.

For example, in FIG. 3A, a first-main portion may be collected aroundpower event 310. Prior to this power event, the amount of power consumedby the first-main was about 1000 watts. Accordingly, a baseline value of1000 watts may be used to normalize the first-main portion bysubtracting 1000 watts from each time-series value of the first-mainportion.

A main power monitoring signal may be compared with a smart-plug powermonitoring signal by comparing features of power events in therespective power monitoring signals. Any appropriate features may becomputed, such as any of the features described in U.S. Pat. No.9,443,195. For example, a feature may be a difference in time or timedelay between a power event in a main power monitoring signal and apower event in a smart-plug power monitoring signal. For anotherexample, a feature of a power event may be a change in an amount ofpower before the power event and after the power event. An amount ofpower before the power event may be determined by taking a powermeasurement at a time before the power event or an average (or median orsome other statistic) over a window of time before the power event. Anamount of power after the power event may similarly be determined. Tocompare a main power monitoring signal with a smart-plug powermonitoring signal, a first power change for a first power event in themain power monitoring signal may be compared with a second power changefor a second power event in the smart-plug power monitoring signal. Insome implementations, a first feature vector may be created for a powerevent in a smart-plug power monitoring signal and a second featurevector may be created for a power event in a main power monitoringsignal. A comparison may be computed using the feature vectors, such asby computing a distance or similarity between the feature vectors.

A main power monitoring signal may be compared with a smart-plug powermonitoring signal using wattage models for devices. Any appropriatewattage models may be used, such as the wattage models described in U.S.Pat. No. 9,443,195. A wattage model may describe an expected amount ofpower consumption for a device over time after the device changes state.A main power monitoring signal may include power events from differentdevices that occur at similar times such that the two power eventsoverlap with each other. The wattage models may be used to separate thetwo power events in the main power monitoring signal so that each of thepower events may be compared with the smart-plug power monitoringsignal.

Determining Main of Smart Plug

In some implementations, it may be desired or useful to know which mainof the house that the smart plug is connected to. For example, knowingthe main that the smart plug receives power from may improve othertechniques that use information from the smart plug as described ingreater detail below. A smart plug could potentially receive power frommore than one main of a house (such as a smart plug for a 240V devices),but the discussion below will focus on a smart plug that receives powerfrom a single main and similar techniques could also be applied to asmart plug that receives power from more than one main.

The electrical main of the smart plug can be determined by comparing asmart-plug power monitoring signal received from the smart plug with afirst-main power monitoring signal and a second-main power monitoringsignal. For devices that are connected to the smart plug, power eventsfrom state changes of the devices may appear in the smart-plug powermonitoring signal and either the first-main or second-main powermonitoring signal.

For example, consider the power monitoring signals of FIGS. 3A-C. InFIG. 3C, the smart-plug power monitoring signal shows power events froma toaster oven that is connected to the smart plug. Because the smartplug receives power from the first-main, the power events of the toasteroven also appear in the first-main power monitoring signal of FIG. 3A.The first-main power monitoring signal also includes power events ofother devices on the first-main that are not connected to the smart plug(e.g., the light bulb), so the smart-plug power monitoring signalincludes only a subset of power events that appear in the first-mainpower monitoring signal. The power events of the toaster oven do notappear in the second-main power monitoring signal because the smart plugdoes not receive power from the second-main.

Although the power events from the smart plug also appear in thefirst-main power monitoring signal, it may not be straightforward todetermine in which main the power events of the smart plug appear. Forexample, the main power monitoring signals may contain a large number ofpower events that overlap with one another, there may be devices in thehouse that are not connected to the smart plug that have power eventswith similar signatures to the power events of the devices that areconnected to the smart plug, and/or the smart-plug power monitoringsignal may have a time delay, resolution (e.g., sampling rate), oramplitude that is different with respect to the main power monitoringsignals.

FIG. 6 is a flowchart of an example implementation of determining themain that provides power to a smart plug. In FIG. 6 and other flowchartsherein, the ordering of the steps is exemplary and other orders arepossible, not all steps are required, and, in some implementations, somesteps may be omitted, or other steps may be added. The process of theflowcharts may be implemented, for example, by any of the computers orsystems described herein.

At step 610, a network connection is established between a power monitorand a smart plug. Any appropriate network connection may be used (e.g.,wired or wireless, Wi-Fi, Bluetooth) and the network connection may bedirect or indirect. For example, the network connection may be via arouter of the house or via a computer that is external to the house. Thenetwork connection may be established using any appropriate techniques.For example, a user may configure one or both of the power monitor andthe smart plug to create a network connection, or the power monitorand/or smart plug may establish a network connection automaticallywithout needing configuration by a person.

At step 615, the power monitor receives a smart-plug power monitoringsignal from the smart plug. In some implementations, the smart-plugpower monitoring signal may provide a real time (or near real time)measurement of the amount of power (or other electrical property)provided to devices connected to the smart plug. In someimplementations, the smart plug may only transmit a power monitoringsignal when the amount of power provided is greater than zero or someother threshold. Signal 303 of FIG. 3C is an example smart-plug powermonitoring signal.

At step 620, a first-main power monitoring signal is obtained usingmeasurements (e.g., current or voltage) of an electrical property of thefirst-main of the house by a first sensor. The first-main powermonitoring signal may provide a real time (or near real time)measurement of the amount of power (or other electrical property)provided to devices receiving power from the first-main. Signal 301 ofFIG. 3A is an example first-main power monitoring signal.

At step 625, a second-main power monitoring signal is obtained usingmeasurements (e.g., current or voltage) of an electrical property of thesecond-main of the house by a second sensor. The second-main powermonitoring signal may provide a real time (or near real time)measurement of the amount of power (or other electrical property)provided to devices receiving power from the second-main. Signal 302 ofFIG. 3B is an example second-main power monitoring signal.

At step 630, power events are detected in the smart-plug powermonitoring signal, and event times of the power events are identified. Apower event may correspond to any state change of a device connected tothe smart plug, such as a device turning on, turning off, or eventsbetween an on event and an off event (such as the cycling of the heatingelement of a toaster oven while the toaster oven is on). Any appropriatetechniques may be used to identify power events, such as any of thetechniques described in U.S. Pat. No. 9,443,195.

Any subset of power events may be used. For example, all on events maybe used, all off events may be used, all on and off events may be used,or all events may be used. An event time may be identified for eachevent, such as a beginning, middle, or end time of the event. Forexample, detected power events may be any of power events 310, 330, 340,350, 360, and 380 of FIG. 3C.

An on event may be determined as a transition from providing zero powerto providing non-zero power. Similarly, an off event may be determinedas a transition from providing non-zero power to zero power. Indetermining, transitions between zero and non-zero power, appropriatethresholds may be used. For example, even when all devices connected tothe smart plug are off, the smart plug may still indicate that arelatively small amount of power is being provided due to electricalleakage in the devices connected to the smart plug or the smart plugitself. A power level below a threshold may be determined to be zeropower even though it may be not precisely zero.

Where more than one device is connected to the smart plug, it ispossible that a first device is on and a second device later turns on.The second device turning on will thus cause a transition in thesmart-plug power monitoring signal from non-zero power to a largeramount of power. Accordingly, when selecting all on events, only onevents from zero to non-zero power may be used, or other techniques maybe used to capture all on events when more than one device is connectedto the smart plug.

At step 635, portions of the smart-plug power monitoring signal (orsmart-plug portions) are collected corresponding to the event times. Forexample, a window of the smart-plug power monitoring signal may becollected around the event time (e.g., a ten second window) or a portionof the smart-plug power monitoring signal may be collected from a timebefore an on event to time after an off event. For example, possiblesmart-plug portions 311, 331, 341, 351, 361, and 381 are shown in FIG.3C.

At step 640, portions of the first-main power monitoring signal (orfirst-main portions) are collected corresponding to the event times, andat step 645, portions of the second-main power monitoring signal (orsecond-main portions) are collected corresponding to the event times.The portions may be collected using similar time frames as thesmart-plug portions or different time frames.

At step 650, the smart-plug portions are compared with the first-mainportions and the second-main portions. Any of the techniques describedherein may be used to compare a smart-plug portion with a first-mainportion and a second-main portion.

Comparisons may be made between the smart-plug portion and thefirst-main portion for each power event, and comparisons may be madebetween the smart-plug portion and the second-main portion for eachpower event. For example, where there are 50 power events, 50comparisons may be made between smart-plug portions and first-mainportions and 50 comparisons may be made between smart-plug portions andsecond-main portions. Each comparison may be represented using anyappropriate techniques, such as by representing a comparison as a number(e.g., a distance between portions).

At step 655, it is determined if the smart plug is powered by thefirst-main or the second-main using the results of the comparisons. Anyappropriate techniques may be used. For example, a first score may becomputed using the comparisons between the smart-plug portions and thefirst-main portions, and a second score may be computed using thecomparisons between the smart-plug portions and the second-mainportions. Any appropriate scores may be computed, such as a statistic ofthe Euclidean distances between portions. The statistic may be a mean,median, sum of squares, or any other appropriate statistic. In someimplementations, it may be determined that the smart plug receives powerfrom the first-main if the first score is larger than the second scoreor if the first score minus the second score is larger than a threshold.In some implementations, if the first score and second score are tooclose to each other, then the decision may be deferred as having lowconfidence and more data may be collected to obtain a more reliabledetermination.

At step 660, a device list, such as the device list of FIG. 5 , isupdated to indicate that the smart plug receives power from the mainidentified at step 655. A device list may be stored in any appropriatedata store. Any other appropriate information may be stored, such as thedate of the determination.

At step 665, information is provided to a user to inform the user thatthe smart plug is receiving power from the identified main, such asusing any of the techniques described herein or in U.S. Pat. No.9,443,195. In some implementations, step 665 may not be performed, andthe user may not be informed regarding the main from which the smartplug is receiving power.

The process of FIG. 6 may be repeated at other times since, for at leastsome smart plugs, the plug may be plugged into a different electricaloutlet and then receive power from a different main. For example, theprocess of FIG. 6 may be repeated once a day or once a week.

In some implementations, an artificial neural network may be used todetermine the main that is providing power to a smart plug. Anyappropriate neural network may be used, such as a recurrent neuralnetwork. A neural network may be trained using a training corpus of datawhere the training corpus includes multiple training examples. Eachtraining example may include a smart-plug power monitoring signal, oneor more main power monitoring signals, and an indication of the mainthat is providing power to the smart plug. For example, smart plug andmain power monitoring signals may be collected over a period of time,such as a day or a week.

The parameters of the neural network may be trained using anyappropriate techniques, such as back propagation and stochastic gradientdescent. To train the neural network, the inputs of the neural networkmay be set to the power monitoring signals, the outputs of the neuralnetwork may be set to indicate the main that is providing power to thesmart plug (e.g., setting a value of 1 for the main that is providingpower to the smart plug and a value of 0 for the other mains). Theparameters of the neural network may then be trained by iterating overthe training data.

After the neural network has been trained, it may be used to determinethe main that is providing power to the smart plug. Smart plug and mainpower monitoring signals may be collected from a house for processing bythe trained neural network. The neural network may process the powermonitoring signals and output a score for each main indicating whetherthe main provides power to the smart plug. For example, the scores maybe probabilities or likelihoods. The scores may be used to identify themain that is providing power to the smart plug, such as by selecting amain having a highest score.

In some implementations, additional power monitoring signals may becollected to increase the confidence in the outcome. For example, afterprocessing one day of power monitoring signals, the scores may be a 0.6probability for a first-main and a 0.4 probability for a second-main.These scores may not provide sufficient confidence and additional datamay be collected. After processing one week of power monitoring signals,the scores may be a 0.9 probability for the first-main and a 0.1probability for the second-main. These scores may provide sufficientconfidence to make a determination, and the first-main may be selectedas providing power to the smart plug.

In some implementations, the main providing power to a smart plug may beidentified as described in the following clauses and combinations of anytwo or more of them.

Determining Devices Connected to Smart Plug

In some implementations, it may be desired to know which devices in thehouse are receiving power from the smart plug. For example, if it isknown which devices are connected to the smart plug, this informationcould be presented to a user. This information may be used to benefitthe user or to improve the functionality of a power monitor.

For example, the user may connect a toaster oven to the smart plug, andthe power monitor may be able to detect state changes of the toasteroven, but the power monitor may not know that the device connected tothe smart plug is a toaster oven. The power monitor may have powermodels for detecting state changes of devices with heating elements(such as a toaster oven, stove, fish tank heater, or a curling iron) andthese models may be able to detect state changes of the toaster ovenwithout knowing that the device is a toaster oven. The power monitor mayreport to a user that “heating element 1” is connected to the smartplug. The user may see this, and then provide information indicatingthat the device connected to the smart plug is a toaster oven.Afterwards, the power monitor may be able to report that the toasteroven turned on instead of reporting that “heating element 1” turned on.

Knowing that the device connected to the smart plug is a toaster ovenmay also help with the identification of state changes of toaster ovensfor other users. For example, a company providing power monitorservices, may use the information received from the user to create powermodels for toaster ovens that may be used with the user's toaster ovenand toaster ovens of other users.

In some instances, the information provided by the user may be used tocorrect mistakes by the power monitor and improve the processing of thepower monitor for the user and other users. For example, the powermonitor may incorrectly determine that a curling iron is connected tothe smart plug and inform the user. The user may then correct thisinformation by indicating the device connected to the smart plug isactually a toaster oven and not a curling iron. This information may beused by a company providing power monitoring services to potentiallyimprove the power models for both toaster ovens and curling irons tobetter distinguish between the two types of devices.

FIG. 7 is a flowchart of an example implementation of determining that afirst device receives power from a smart plug. Before performing thesteps of FIG. 7 , it may be determined that the smart plug is receivingpower from the first-main, such as by performing the steps of FIG. 6 .At step 710, a network connection is established between a power monitorand a smart plug; at step 715, the power monitor receives a smart-plugpower monitoring signal from the smart plug; and at step 720, afirst-main power monitoring signal is obtained using measurements of anelectrical property of the first-main of the house by a first sensor.These steps may be performed using any of the techniques described abovefor steps 610, 615, and 620.

At step 725, a smart-plug power event is identified in the smart-plugpower monitoring signal, where the smart-plug power event occurs to anevent time. Any appropriate techniques may be used to identify a powerevent, such as any of the techniques described in U.S. Pat. No.9,443,195. In some implementations, a power event may be identified bydetecting a transition in the smart-plug power monitoring signal fromzero power to non-zero power (e.g., caused by a device connected to thesmart plug being turned on). An event time may be determined using anyappropriate techniques, such as a beginning, middle, or end of the powerevent.

In some implementations, at step 725, multiple smart-plug power eventsmay be identified. For example, a smart-plug power monitoring signal maybe processed for a duration of time, such as 24 hours or 7 days, andmultiple smart-plug power events may be identified. The identifiedsmart-plug power events may correspond to the same type of power event(e.g., a device turning on or a transition from zero power to non-zeropower) or may include multiple types of power events (e.g., a deviceturning on and a device turning off).

Since it is known that the smart plug is receiving power from thefirst-main, the device that caused the smart-plug power event will alsocause a power event in the first-main power monitoring signal at aroundthe event time.

At step 730, a first-main power event is identified in the first-mainpower monitoring signal using the event time determined at step 725. Anyappropriate techniques may be used to select the first-main power event.For example, the first-main power monitoring signal may include multiplepower events near the event time, and a power event that is closest tothe event time may be selected. In some implementations, there may be aknown time delay, or a time delay may be measured between the smart-plugpower monitoring signal and the first-main power monitoring signal. Thisknown or measured time delay may be used in selecting the first-mainpower event.

In some implementations, more than one power event of the first-mainpower monitoring signal may be identified as step 730. For example, thefirst-main power monitoring signal may contain a first first-main powerevent and a second first-main power event that are close in time to theevent time. Each of the first first-main power event and the secondfirst-main power event may be compared with the smart-plug power event(or portions of power monitoring signals containing the power events maybe compared). The first-main power event that has the closest comparisonto the smart-plug power event may be selected.

Where multiple smart-plug power events are identified at step 725, afirst-main power event may be identified at step 730 for each smart-plugpower event using the techniques described above. Accordingly, afterstep 730, multiple pairs of smart-plug power events and first-main powerevents may be available for further processing.

At step 735, the identified first-main power event is processed todetermine that the first-main power event corresponds to a first device.For example, the first-main power event may be processed by a pluralityof power models where each power model corresponds to a device (e.g., atype of device (a television), a make/version of a device (A Toshibatelevision), or a particular device (the living room television)). Eachpower model may output a score indicating a match between the first-mainpower event and the device corresponding to the power model. The firstdevice may be selected by processing the scores, such as by selecting apower model having a highest score.

In some implementations, a state change of a device may be identified,and the device may be identified from the state change. For example,each of the power models may correspond to a state change of a device,and a power model may be selected using model scores, and where thestate change corresponds to a state change of the first device, it maybe determined that the power event corresponds to the first device.

Where multiple pairs of smart-plug power events and first-main powerevents are identified at steps 725 and 730, step 735 may be performedfor each first-main power event to identify a device (which may be thefirst device or a different device) corresponding to the power event.

At step 740, it is determined that the first device receives power fromthe smart plug. Where only one first-main power event was processed atstep 735, it may be determined that the first device receives power fromthe smart plug as a result of the first-main power event correspondingto the first device and the first-main power event corresponding to thesmart-plug power event.

Where multiple first-main power events are identified and processed atsteps 725 to 735, other techniques may be used to determine that thefirst device receives power from the smart plug.

In some implementations, a count of devices identified at step 735 formultiple first-main power events may be used to determine that the firstdevice receives power from the smart plug. For example, suppose that 100first-main power events are processed at step 735, and that 75 weredetermined to correspond to the first device, 15 to correspond to asecond device, and 10 to correspond to a third device. Since the firstdevice had the highest count, it may be selected as receiving power fromthe smart plug.

In some implementations, comparisons between smart-plug power events andfirst-main power events may be used to make the determination at step740. A smart-plug power event and a first-main power event (or portionsof power monitoring signals containing the power events) may be comparedusing any of the techniques described herein. Each comparison maygenerate a distance between power the events (or corresponding portionsof power monitoring signals). The distances may then be used todetermine that the first device receives power from the smart plug.

For example, for each first-main power event that is determined tocorrespond to the first device at step 735, a distance may be computedbetween the first-main power event and the corresponding smart-plugpower event. As a result, a plurality of distances may be computed forthe first device. The plurality of distances for the first device may becombined into a score, such as by using any of the techniques describedabove for step 655. This score for the first device may then be used todetermine if the first device receives power from the smart plug. Forexample, the score for the first device may be compared to a threshold,or the value for the first device may be compared to similar scorecomputed for other devices, and a device with a highest score may beselected.

In some implementations and instances, a smart plug may provide power tomore than one device (e.g., a smart power strip). In such instances,more than one device may be selected as receiving power from the smartplug. For example, all devices with a score (e.g., computed fromdistances as described above) above a threshold may be selected asreceiving power from the smart plug.

At step 745, a device list, such as the device list of FIG. 5 , isupdated to indicate that the first device receives power from the smartplug. A device list may be stored in any appropriate data store. Anyother appropriate information may be stored, such as the date of thedetermination.

At a later time, the first device may be removed from the smart plug andplugged directly into an electrical outlet. Afterwards, it may bedetermined that the first device is no longer receiving power from thesmart plug and the device list may be updated to indicate that the firstdevice is no longer receiving power from the smart plug. For example, apower event may be detected in the first-main power monitoring signal atan event time. This power event may be processed with power models todetermine that the power event corresponds to the first devicetransitioning from an off state to an on state, and accordingly that thefirst device is receiving power after the power event. The smart-plugpower monitoring signal may then be processed to determine whether itcontains a power event corresponding to the first device turning on atapproximately the event time. Where it does not (e.g., the smart-plugpower monitoring signal indicates that no power is being provided to anydevices) then it may be determined that the first device is no longerconnected to the smart plug.

At step 750, information is provided to a user to inform the user thatthe first device is receiving power from the smart plug, such as usingany of the techniques described herein or in U.S. Pat. No. 9,443,195. Insome implementations, step 750 may not be performed, and the user maynot be informed that the first device is receiving power from the smartplug.

In some implementations, a device connected to a smart plug may beidentified as described in the following clauses and combinations of anytwo or more of them.

Identifying Device State Changes Using a Smart Plug

The information about which devices are connected to a smart plug may beused to improve the identification of device state changes in the house.For example, suppose that it is known that a first device is connectedto a smart plug (e.g., using the method of FIG. 7 ) and that a seconddevice is not connected to a smart plug.

The knowledge of which devices are connected to the smart plug incombination with the smart-plug power monitoring signal may be used toincrease the accuracy of identifying device state changes in the house.The first device and the second device may have similar electricalsignatures, and it may thus be more likely that state changes of thefirst device are mistakenly identified as state changes of the seconddevice (or vice versa). Since it is known that the first device isconnected to the smart plug and the second device is not, thisinformation may be used to reduce the likelihood of making mistakes whenidentifying state changes of the first and second devices.

For example, a first-main power event may be detected in the first-mainpower monitoring signal at an event time. When information from a smartplug is not available, this first-main power event may be processed withthe first power models for the first device and the second power modelsfor the second device (and possibly other power models) to identify thedevice state change corresponding to the first-main power event. Becausethe first and second devices have similar signatures, a first-main powerevent caused by the first device may be incorrectly identified as astate change of the second device and vice versa.

The smart-plug power monitoring signal may be used to reduce the errorrate. For example, where the smart-plug power monitoring signalindicates that no power is being provided to connected devices at ornear the event time, this information may be used to improve theaccuracy of identifying a device state change from the first-main powerevent. Because that smart plug indicates that it is not providing power,it may be presumed that the first device is off and accordingly that thefirst-main power event cannot correspond to the first device.Accordingly, the first-main power event may be processed by a subset ofall the available power models that excludes power models correspondingto the first device. Because power models corresponding to the firstdevice are excluded, an error rate in identifying state changes may bereduced. For example, where the first-main power event corresponds to astate change of the second device it cannot be incorrectly identified asa state change of the first device since the first power models for thefirst device are not being used.

FIG. 8A is a flowchart of an example implementation of determiningdevice state changes using a smart-plug power monitoring signal. Beforeperforming the steps of FIG. 8A, it may be determined that the smartplug is receiving power from the first-main, such as by performing thesteps of FIG. 6 . It may also be determined that a first device isconnected to the smart plug, such as by performing the steps of FIG. 7 .

At step 870, information is obtained indicating that a first device isconnected to a smart plug and that a second device is not connected tothe smart plug. For example, the information may be obtained from adevice list, such as any of the device lists described herein.

At step 872, a network connection is established between a power monitorand a smart plug; at step 874, the power monitor receives a smart-plugpower monitoring signal from the smart plug; and at step 876, afirst-main power monitoring signal is obtained using measurements of anelectrical property of the first-main of the house by a first sensor.These steps may be performed using any of the techniques described abovefor steps 610, 615, and 620.

At step 878, a first-main power event is identified in the first-mainpower monitoring signal. Any appropriate techniques may be used toidentify the first-main power event, such as any of the techniquesdescribed in U.S. Pat. No. 9,443,195.

At step 880, it is determined that the smart-plug power monitoringsignal does not contain a power event corresponding to the first-mainpower event. Any appropriate techniques may be used. A first time of thefirst-main power event may be used to process a portion of thesmart-plug power monitoring signal that includes or is close to the timeof the first-main power event. In some implementations, it may bedetermined that the smart-plug power monitoring signal does not containa power event corresponding to the first-main power event if thesmart-plug power monitoring signal has a value of zero (or close tozero) during a window of time around the first time.

In some implementations, the first-main power event may be compared withpower events in the smart-plug power monitoring signal that are near thefirst time, such as by using any of the techniques described herein. Ifthe first-main power event is not similar to any of the power events inthe smart-plug power monitoring signal, then it may be determined thatthe smart-plug power monitoring signal does not contain a power eventcorresponding to the first-main power event.

At step 882, a subset of power models is selected from a plurality ofpower models where the subset excludes at least one power model for thefirst device and includes at least one power model of the second device.The power models for the first device may be excluded, for example,since the first device is connected to the smart plug, and the smartplug indicates that no power is being consumed for devices connected tothe smart plug.

At step 884, it is determined that the second device changed state byprocessing the first-main power event with the selected subset of powermodels. For example, each power model may compute a score indicating amatch between the first-main power event and a device state change, anda device state change may be selected that corresponds to a highestscore.

At step 886, a device list is updated using the identified device statechange at step 884. A device list may be stored in any appropriate datastore.

At step 888, information about the device state change identified atstep 884 may be provided to a user, such as using any of the techniquesdescribed herein or in U.S. Pat. No. 9,443,195. In some implementations,step 888 may not be performed, and the user may not be informed aboutthe device state change.

A variation of the flowchart of FIG. 8A may also be used whenidentifying state changes of the first device that is connected to thesmart plug. At step 880, it may instead be determined that thesmart-plug power monitoring signal does contain a power eventcorresponding to the first-main power event. For example, the first-mainpower event may be compared with the power events of the smart-plugpower monitoring signal, and it may be determined that features of thefirst-main power event are close to features of a smart-plug powerevent. At step 882, at least one power model of the second device may beexcluded and at least one power model of the first device may beincluded. At step 884, it may be determined that the first devicechanged state by processing the first-main power event with the selectedsubset of power models. Accordingly, the processing of FIG. 8A may beused to identify state changes of devices that are connected to smartplugs and state changes of devices that are not connected to smartplugs.

In some implementations, device state changes may be identified asdescribed in the following clauses and combinations of any two or moreof them.

Clause 1. A computer-implemented method for identifying state changes ofdevices in a building, the method comprising: retrieving informationfrom a device list indicating that a first device of the building isconnected to a smart plug and that a second device of the building isnot connected to the smart plug; establishing a network connection withthe smart plug, wherein the smart plug provides power to one or moredevices; receiving a smart-plug power monitoring signal via the networkconnection, wherein the smart-plug power monitoring signal indicates anamount of power provided over time by the smart plug to the one or moredevices; obtaining a first-main power monitoring signal usingmeasurements from a sensor that measures an electrical property of afirst electrical main of a building; identifying a first-main powerevent in the first-main power monitoring signal, wherein the first-mainpower event corresponds to a state change of the second device;determining that the smart-plug power monitoring signal does not includea power event corresponding to the first-main power event; selecting asubset of power models from a plurality of power models, whereinselecting the subset comprises (i) excluding at least one power modelcorresponding to the first device and (ii) including at least one powermodel corresponding to the second device; processing the first-mainpower monitoring signal with the selected subset of power models todetermine that the first-main power event corresponds to the statechange of the second device; and updating an entry in the device listfor the second device to indicate a current state of the second device.

Clause 2. The computer-implemented method of clause 1, whereindetermining that the smart-plug power monitoring signal does not includea power event corresponding to the first-main power event comprises:determining that the smart-plug power monitoring signal indicates thatit is not providing power to devices connected to the smart plug duringa window of time around the first-main power event.

Clause 3. The computer-implemented method of clause 1, whereindetermining that the smart-plug power monitoring signal does not includea power event corresponding to the first-main power event comprises:determining that the smart-plug power monitoring signal has a value ofzero during a window of time around the first-main power event.

Clause 4. The computer-implemented method of clause 1, whereindetermining that the smart-plug power monitoring signal does not includea power event corresponding to the first-main power event comprises:comparing the first-main power event to one or more power events in thesmart-plug power monitoring signal.

Clause 5. The computer-implemented method of clause 4, whereindetermining that the smart-plug power monitoring signal does not includea power event corresponding to the first-main power event comprises:computing a first feature vector comprising features of the first-mainpower event; computing a second feature vector comprising features of apower event in the smart-plug power monitoring signal; and comparing thefirst feature vector and the second feature vector.

Clause 6. The computer-implemented method of clause 1, whereindetermining that the smart-plug power monitoring signal does not includea power event corresponding to the first-main power event comprises:computing a distance between a portion of the first-main powermonitoring signal comprising the first-main power event and a portion ofthe smart-plug power monitoring signal.

Clause 7. The computer-implemented method of clause 1, whereindetermining that the smart-plug power monitoring signal does not includea power event corresponding to the first-main power event comprises:determining a time difference between the first-main power event and apower event in the smart-plug power monitoring signal.

Clause 8. The computer-implemented method of clause 1, comprising:identifying a second first-main power event in the first-main powermonitoring signal, wherein the second first-main power event correspondsto a state change of the first device; determining that the smart-plugpower monitoring signal includes a power event corresponding to thesecond first-main power event; selecting a second subset of power modelsfrom the plurality of power models, wherein selecting the subsetcomprises (i) including at least one power model corresponding to thefirst device and (ii) excluding at least one power model correspondingto the second device; processing the first-main power monitoring signalwith the selected subset of power models to determine that the powerevent corresponds to the state change of the first device; and updatingan entry in the device list for the first device to indicate a currentstate of the first device.

It is possible, however, that the information in the device list is outof date and that the first device has been removed from the smart plugand has been plugged directly into an electrical outlet. Excluding thefirst power models entirely in processing the first-main power event maythus result in errors after the first device has been moved. In someimplementations, weights may be used reduce the likelihood of errorsinstead of excluding power models entirely. Weights may be selectedusing any appropriate techniques. For example, where the smart plugindicates that it is not providing power to any connected devices, aweight of 1 may be used with the second device and a weight less than 1may be used with the first device. The weights may be used to influencedecisions instead of making hard decisions as described above. Forexample, a first weighted score may be computed by combining the firstweight with a first score computed by a first power model for the firstdevice (as described above) and a second weighted score may be computedby combining the second weight with a second score computed by a secondpower model for the second device. The weighted scores may then be usedto select a device state change corresponding to a power event.

In some implementations, a first-main power event may be compared with asmart-plug power event to determine model weights. For example, afirst-main power event may occur at an event time. This first-main powerevent may be compared with smart-plug power events that are close to theevent time. Where the first-main power event is close to a smart plugevent, power models for devices receiving power from the smart plug maybe given higher weights and power models for devices not receiving powerfrom the smart plug may be given lower weights. Conversely, where thefirst-main power event is not close to a smart plug event, power modelsfor devices receiving power from the smart plug may be given lowerweights and power models for devices not receiving power from the smartplug may be given higher weights. The weights may be computed, forexample, using a distance between the first-main power event and thesmart-plug power event. The weights may also be computed using a timedifference between the first-main power event and the smart-plug powerevent.

FIG. 8B is a flowchart of an example implementation of determiningdevice state changes using a smart-plug power monitoring signal. Beforeperforming the steps of FIG. 8B, it may be determined that the smartplug is receiving power from the first-main, such as by performing thesteps of FIG. 6 . It may also be determined that a first device isconnected to the smart plug, such as by performing the steps of FIG. 7 .

At step 810, information is obtained indicating that a first device isconnected to a smart plug and that a second device is not connected tothe smart plug. For example, the information may be obtained from adevice list, such as any of the device lists described herein.

At step 815, a network connection is established between a power monitorand a smart plug; at step 820, the power monitor receives a smart-plugpower monitoring signal from the smart plug; and at step 825, afirst-main power monitoring signal is obtained using measurements of anelectrical property of the first-main of the house by a first sensor.These steps may be performed using any of the techniques described abovefor steps 610, 615, and 620.

At step 830, a power event is identified in the first-main powermonitoring signal. Any appropriate techniques may be used to identify apower event, such as any of the techniques described in U.S. Pat. No.9,443,195.

At step 835, a match score is computed using the first-main power eventand the smart-plug power monitoring signal where the match scoreindicates a similarity between the first-main power event and thesmart-plug power monitoring signal. Any of the techniques describedherein may be used to compute the match score. For example, the matchscore may be computed as a distance between a portion of the first-mainpower monitoring signal containing the power event and a portion of thesmart-plug power monitoring signal. The match score may also be computedby comparing the first-main power event with a smart-plug power event inthe smart-plug power monitoring signal (e.g., comparing changes in powercaused by the power events).

At step 840, a first weight is computed for the first device and asecond weight is computed for the second device using the match scoreand the information that the first device is connected to the smart plugand that the second device is not connected to the smart plug. Weightsmay also be computed for any other devices in the house. The weights maybe computed using any appropriate techniques.

In some implementations, because the first device is connected to thesmart plug, the first weight may be high where the match score is high(indicating a close match between the first-main power event and thesmart-plug power monitoring signal) and the first weight may be lowwhere the match score is low. For example, the first weight may be equalto the match score. Conversely, the second weight may be low when thematch score is high, and the second weight may be high when the matchscore is low. For example, where the match score ranges between 0 and 1,the second score may be one minus the match score.

In some implementations, it may be determined that the smart-plug powermonitoring signal is not providing any power during a time window aroundan event time of the first-main power event. Accordingly, the firstweight may be set to zero since the first device is likely not consumingpower and thus likely did not cause the first-main power event.

At step 845, the first-main power event is processed with power modelswhere each model may correspond to a state change of a device. Eachpower model may output a score indicating a match between the first-mainpower event and the corresponding device state change. For example, thepower models may include a first power model for a state change of thefirst device that outputs a first score, and a second power model for astate change of the second device that outputs a second score. Where aweight is zero, the processing for a power model may be skipped becausea zero weight may indicate that a corresponding device is being excludedfrom consideration.

At step 850, a device state change is identified using the first weightand the second weight and the scores from step 845. For example, a firstweighted score may be computed using the first score and the firstweight (e.g., by multiplying them or any other appropriate combination)and a second weighted score may be computed using the second score andthe second weight. A device state change may then be selected using theweighted scores, such as by selecting a device state changecorresponding to a highest weighted score. For example, where the firstweighted score is highest, the state change of the first device may beselected, and where the second weighted score is highest, the statechange of the second device may be selected.

At step 855, a device list is updated using the identified device statechange at step 850. A device list may be stored in any appropriate datastore.

At step 860, information about the device state change identified atstep 850 may be provided to a user, such as using any of the techniquesdescribed herein or in U.S. Pat. No. 9,443,195. In some implementations,step 860 may not be performed, and the user may not be informed aboutthe device state change.

In some implementations, device state changes may be identified asdescribed in the following clauses and combinations of any two or moreof them.

Clause 1. A computer-implemented method for identifying state changes ofdevices in a building, the method comprising: retrieving informationfrom a device list indicating that a first device of the building isconnected to a smart plug and that a second device of the building isnot connected to the smart plug; establishing a network connection withthe smart plug, wherein the smart plug provides power to one or moredevices; receiving a smart-plug power monitoring signal via the networkconnection, wherein the smart-plug power monitoring signal indicates anamount of power provided over time by the smart plug to the one or moredevices; obtaining a first-main power monitoring signal usingmeasurements from a sensor that measures an electrical property of afirst electrical main of a building; identifying a first-main powerevent in the first-main power monitoring signal, wherein the first-mainpower event corresponds to a state change of the first device; computinga match score using the first-main power event and the smart-plug powermonitoring signal; computing, using the match score, a first weight fora first power model for the first device and a second weight for asecond power model for the second device, wherein the first weight islarger than the second weight; processing the first-main power eventwith the first power model, the first weight, the second power model,and the second weight to determine that the first-main power eventcorresponds to the state change of the first device; and updating anentry in the device list for the first device to indicate a currentstate of the first device.

Clause 2. The computer-implemented method of clause 1, wherein computingthe match score comprises: identifying a smart-plug power event in thesmart-plug power monitoring signal; and comparing the first-main powerevent and the smart-plug power event.

Clause 3. The computer-implemented method of clause 1, wherein computinga match score comprises computing a distance between a portion of thefirst-main power monitoring signal comprising the first-main power eventand a portion of the smart-plug power monitoring signal.

Clause 4. The computer-implemented method of clause 1, wherein computingthe match score comprises using a difference in time between thefirst-main power event and a smart-plug power event in the smart-plugpower monitoring signal.

Clause 5. The computer-implemented method of clause 1, wherein the firstweight is one and the second weight is zero.

Clause 6. The computer-implemented method of clause 1, whereinprocessing the first-main power event with the first power model, thefirst weight, the second power model, and the second weight to determinethat the first-main power event corresponds to the state change of thefirst device comprises: processing the first-main power event with thefirst power model to produce a first score; computing a first weightedscore using the first score and the first weight; processing thefirst-main power event with the second power model to produce a secondscore; computing a second weighted score using the second score and thesecond weight; and determining that the first-main power eventcorresponds to the state change of the first device using the firstweighted score and the second weighted score.

Clause 7. The computer-implemented method of clause 1, comprising:identifying a second first-main power event in the first-main powermonitoring signal, wherein the second first-main power event correspondsto a state change of the second device; computing a second match scoreusing the second first-main power event and the smart-plug powermonitoring signal; computing, using the second match score, a thirdweight for the first power model for the first device and a fourthweight for the second power model for the second device, wherein thefourth weight is larger than the third weight; processing the secondfirst-main power event with the first power model, the third weight, thesecond power model, and the fourth weight to determine that the secondfirst-main power event corresponds to the state change of the seconddevice; and updating an entry in the device list for the second deviceto indicate a current state of the second device.

Training Models Using a Smart Plug

A smart plug may assist in training mathematical models for devices. Totrain mathematical models for a device, a training corpus of powermonitoring signals may be obtained that includes examples of the devicechanging states (e.g., turning on and turning off). For some devices, itmay be relatively easy to collect a sufficient amount of training datato train models for the devices. For example, the devices may changestate relatively frequently or have power events that are relativelyeasy to identify in a main power monitoring signal (e.g., because oflarge power changes or distinctive signatures in state transitions).

For some devices, however, it may be more challenging to collect asufficient amount of training data to train models. For example, thedevice may change state relatively infrequently, the power changes ofstate transitions may be relatively small, or the signatures of statechanges may be similar to state changes of other devices. A smart plugmay facilitate the collection of training data for such devices.

A user may intentionally connect a device to a smart plug for thepurpose of training a model for the device. For example, afterconnecting the device to the smart plug, the user may submit a requestto a company providing the power monitoring services to train a modelfor the device. Alternatively, a user may connect a device to a smartplug for other reasons, and a power monitor may determine thatmathematical models are not available for the device connected to thesmart plug, and the power monitor may proceed to collect data from thesmart plug for the purpose of training mathematical models for thedevice.

The power models that may be trained for a device include any of themathematical models described in U.S. Pat. No. 9,443,195, such astransition models, device models (referred to herein as state models),and wattage models.

FIG. 9 is a flowchart of an example implementation of trainingmathematical models for a device using a smart-plug power monitoringsignal. At step 910, a power monitor receives a smart-plug powermonitoring signal from a smart plug. This step may be performed usingany of the techniques described above for step 615. For example, priorto receiving the smart-plug power monitoring signal from the smart plug,a network connection may be established between the power monitor andthe smart plug.

At step 915, turn-on times are determined by processing the smart-plugpower monitoring signal. For example, a turn-on time may be determinedas a time corresponding to a transition from zero power to non-zeropower in the smart-plug power monitoring signal. Appropriate thresholdsmay be used, as described above, so that zero power may correspond to anamount of power below a threshold and need not be precisely zero. Theturn-on times may be identified by processing the smart-plug powermonitoring signal over a period of time, such as a day, a week, or amonth. The turn-on times may all correspond to a first device turning onor may correspond to multiple devices turning on (e.g., where multipledevices are connected to the smart plug).

At step 920, turn-off times are determined by processing the smart-plugpower monitoring signal. For example, a turn-off time may be determinedas a time corresponding to a transition from non-zero power to zeropower in the smart-plug power monitoring signal (e.g., using appropriatethresholds). The turn-off times may be identified by processing thesmart-plug power monitoring signal over a period of time, such as a day,a week, or a month. The turn-off times may all correspond to a firstdevice turning off or may correspond to multiple devices turning off(e.g., where multiple devices are connected to the smart plug).

At step 925, a first-main power monitoring signal is obtained. This stepmay be performed using any of the techniques described above for step620. In some implementations, a first-main power monitoring signal maybe selected from among other power monitoring signals (e.g., asecond-main power monitoring signal) where it has been previouslydetermined that the smart plug receives power from the first-main, suchas by using techniques described herein.

At step 930, power events are identified in the first-main powermonitoring signal. A power event may indicate that a device (which mayor may not receive power from the smart plug) changed state, such asturning on or off. A power event may be identified using any appropriatetechniques, such as any techniques described herein or in U.S. Pat. No.9,443,195. Each power event may be associate with an event time, and anevent time may be stored for each power event. The power events may beidentified by processing the first-main power monitoring signal over aperiod of time, such as a day, a week, or a month.

At step 935, the power events are clustered into a plurality ofclusters. Any appropriate techniques may be used to cluster the powerevents, such as by computing features from the power events and thenclustering using the features. Any appropriate features may be used,such as a match between the power event and a template, Fouriercoefficients, neural network features, or a change in power, current,voltage, or phase before and after the power event. Any appropriateclustering techniques may be used, such as k-means clustering,hierarchical clustering, centroid-based clustering, or density-basedclustering.

The clustering of the power events may result in similar power eventsbeing in the same cluster and non-similar power events being indifferent clusters. For example, all turn-on power events for aparticular device may be in the same cluster. In some instances, acluster may include only a specific power event for a specific device,such as power events for the toaster oven turning on. In some instances,a cluster may include power events from more than one device, such aspower events for the toaster oven turning on and power events for acurling iron turning on.

At step 940, a first cluster of the plurality of clusters is selectedusing the turn-on times and the event times of power events in the firstcluster. Any appropriate techniques may be used to select the firstcluster. For example, the event times of the power events of the firstcluster may be compared to the turn-on times. In some implementations, ascore may be computed for each cluster of the plurality of clusters thatindicates a match between the event times of the power events of thecluster and the turn-on times, and a cluster having a highest score maybe selected. For example, a score for a cluster may be a fraction orpercentage of power events in the cluster that are within a time windowof a turn-on time, such as with 5 seconds of a turn-on time. Where manyevent times of cluster are close to turn-on times, it may be more likelythat the cluster corresponds to a device connected to the smart plugturning on.

At step 945, a second cluster of the plurality of clusters is selectedusing the turn-off times and the event times of power events in thesecond cluster. Any appropriate techniques may be used to select thesecond cluster, such as the techniques described at step 940.

At step 950, a first transition model is trained using one or more ofthe power events of the first cluster. Any appropriate transition modelmay be trained using any appropriate techniques, such as any transitionmodels or techniques described herein or in U.S. Pat. No. 9,443,195. Insome implementations, a subset of the power events in the first clustermay be used to train the first transition model. For example, only powerevents that are within a time window of a turn-on time may be used totrain the first transition model.

At step 955, a second transition model is trained using one or more ofthe power events of the second cluster. Any appropriate techniques maybe used to train the second transition model, such as the techniquesdescribed at step 950.

At step 960, the first and second transition models are used to identifystate changes of devices. For example, the first and second transitionmodels may be deployed to a power monitor in the same building fromwhich the smart plug and first-main power monitoring signals wereobtained. The first and second transition models may be used to identifystate changes (e.g., turning on and off) of a device that is connectedto the smart plug or to a device that is not (or no longer) connected tothe smart plug.

In some implementations, the first and second transition models may beused in a building different from the building from which the smart plugand first-main power monitoring signals were obtained. For example, thefirst and second transition models may have been trained from powerevents corresponding to a toaster oven turning on and off in a firstbuilding, and the first and second transition models may be used in asecond building to identify power events from a toaster oven turning onor off.

For some devices, it may be desired to train more than two transitionmodels. For a device like a light bulb with only two states (on andoff), two transition models may be sufficient. A first transition modelmay describe a transition from the off state to the on state, and asecond transition model may describe a transition from the on state tothe off state. By comparison, an air conditioner, may have a first statethat is an off state, a second state where a condenser motor isoperating and a blower motor is not operating, and a third state whereboth the condenser motor and the blower motor are operating. It may bedesired to have a first transition model for the air conditionertransitioning from the first state (the off state) to the second state(only condenser motor operating), a second transition model fortransitioning from the second state to the third state (blower motorturning on in addition to the condenser motor), and a third transitionmodel for transition from the third state back to the first state. Forother devices, additional device states and transition models may bedesired.

FIG. 10 is a flowchart of an example implementation of training morethan two mathematical models for a device using a smart-plug powermonitoring signal. The processing of FIG. 10 may be used, for example,in conjunction with the processing of FIG. 9 .

At step 1010, a state model is initialized for a device that receivespower from the smart plug where the state model has two states. Forexample, the first state may correspond to the device being off and thesecond state may correspond to the device being on. The state model mayinclude a first transition from the first state to the second state anda second transition from the second state to the first state. FIG. 11Aillustrates an example state model with two states where, for example,state 1 may be an off state and state 2 may be an on state.

At step 1015, a first cluster of power events is selected for the firsttransition, and at step 1020, a second cluster of power events isselected for the second transition. Steps 1015 and 1020 may use any ofthe techniques described herein, such as any of the techniques of FIG. 9. For example, turn-on times and turn-off times may be identified in apower monitoring signal, power events may be identified in a first-mainpower monitoring signal, the power events may be clustered into aplurality of clusters, and the first and second clusters may be selectedusing the turn-on times, the turn-off times, and the event times ofpower events.

At step 1025, a goodness of fit is determined between the state modeland the device being modeled. Any appropriate techniques may be used todetermine the goodness of fit.

Where a device has only two states (e.g., on and off), the device mayconsume zero power when it is off and a relatively constant amount ofpower when it is on. A first transition may be from zero power to atypical power usage for the device. The device may continue to consumethe typical power usage until the second transition from the typicalpower usage to zero power. FIG. 12A illustrates an example of a powermonitoring signal for a device with two states where the device consumes0 watts when it is off and 100 watts when it is on. A state model withtwo states may be a good fit for the device of FIG. 12A.

When a device has more than two states, the amount of power consumed bythe device over time may change while it is on. A first transition maybe from zero power to a first typical power usage for the device (e.g.,a condenser motor). The device may continue to consume the typical powerusage until a second transition from the first typical power usage to asecond typical power usage (e.g., both a condenser motor and a blowermotor). A third transition may be back to zero power. FIG. 12Billustrates an example of power monitoring signal for a device withthree states where the device consumes 0 watts when it is off, consumes50 watts after it is turned on, and consumes 100 watts at a later time.A state model with two states may not be a good fit for the device ofFIG. 12B.

A goodness of fit may be determined, for example, by creating a wattagemodel for the device. Any appropriate wattage model may be used, such asany wattage models described herein or in U.S. Pat. No. 9,443,195. Awattage model may be created by computing an expected change in powerconsumption corresponding to a transition from a first state to a secondstate.

Any appropriate techniques may be used to determine an expected changein power consumption corresponding to a transition, and the expectedchange may be computed from one or both of the smart-plug powermonitoring signal and the first-main power monitoring signal. For eachpower event corresponding to a transition, an amount of power may bedetermined for both before and after the power event. The amount ofpower may be, for example, an amount of power at a specific time (e.g.,2 seconds before and after the power event) or an average of powerconsumption over a time window (e.g., a window from 1-3 seconds beforeand after the power event). A power change may be determined for eachpower event by computing a change in power before and after the powerevent.

An expected change in power consumption for a transition may be computedfrom the power changes of the power events corresponding to thetransition. Any appropriate techniques may be used, such as computing astatistic of the power changes of the power events. For example, thestatistic may be a mean or median of the power changes of the powerevents (and outliers may be excluded).

A wattage model for a device may be that the device consumes arelatively constant amount of power while the device is in a particularstate, and the expected amount of power may correspond to a power changeof a transition to the particular state.

A goodness of fit of the state model may be determined by comparing thewattage model to the actual power consumption indicated by the powermonitoring signal. For example, a wattage model for the device of FIG.12A may indicate that the device is expected to consume 99 watts whilethe device is on (as indicated by the dashed line). In the powermonitoring signal of FIG. 12A, the device is actually consuming 100watts so the wattage model is close to the power monitoring signal andstate model a good fit to the power monitoring signal. By contrast, awattage model for the device of FIG. 12B may indicate that the device isexpected to consume 90 watts while the device is on (as indicated by thedashed line). In the power monitoring signal of FIG. 12B, the device isactually consuming 50 watts or 100 watts so the state model is not agood fit to the power monitoring signal.

The goodness of fit between a state model and a particular powermonitoring signal may be computed using any appropriate techniques. Forexample, a distance between a wattage model and a particular powermonitoring signal may be computed by sampling the power monitoringsignal at a sequence of intervals and computing a sum of squares of thedifferences between the samples and the expected amount of powerindicated by the wattage model.

A smart-plug power monitoring signal may have multiple examples of thedevice turning on and off, and a goodness of fit may be computed foreach example of the device turning on and off. A goodness of fit of thestate model to the device may be computed by combining the goodness offit of the state model to each example in the smart-plug powermonitoring signal. For example, the goodness of fit of the state modelto the device may be a mean or median of the goodness of fit valuescomputed for each example of the device being in an on state in thesmart-plug power monitoring signal (and outliers may be excluded).

The goodness of fit may be used to decide whether to add another stateto the state model. For example, the goodness of fit may be compared toa threshold. Where the goodness of fit computed at step 1025 is notsufficient, processing may proceed to step 1030.

At step 1030, a new state is added to the state model. For example, FIG.11B illustrates a state model where a third state has been insertedafter the second state of FIG. 11A. For example, state 1 may stillcorrespond to an off state, state 2 may correspond to a first operatingstate (e.g., only the condenser motor is operating), and state 3 maycorrespond to a second operating state (e.g., both the condenser andblower motors are operating). Accordingly, the transition from state 1to state 2 may correspond to the device turning on, the transition fromstate 2 to state 3 may corresponding to a change in operation while thedevice is on, and the transition from state 3 to state 1 may correspondto the device turning off. In this example, the state model includesonly the three transitions indicated in FIG. 11B, but in someimplementations, additional transitions may be included, such as addingtransitions between each pair of states.

After adding the third state, the first cluster of power events may beassigned to the transition from state 1 to state 2 (the device turningon) and the second cluster of power events may be assigned to thetransition from state 3 to state 1 (the device turning off).

At step 1035, a cluster of power events is selected for the transitionto the new state (e.g., a change from state 2 to state 3 in FIG. 11B).Because the transition to the new state occurs while the device isalready on, the transition should generally occur between a turn-on timeand a subsequent turn-off time. Accordingly, the third cluster may beselected by comparing event times of the power events of the selectedcluster with times where the device connected to the smart plug is in anon state (e.g., between a turn-on time and a subsequent turn-off timeobtained from the smart-plug power monitoring signal). In someimplementations, a score may be computed for each cluster of theplurality of clusters that indicates a match between the event times ofthe power events of the cluster and times between a turn-on time and asubsequent turn-off time. A cluster having a highest score may then beselected. For example, a score for a cluster may be a fraction orpercentage of power events in the cluster that are between a turn-ontime and a subsequent turn-off time. Where many event times of clusterare in this range, it may be more likely that the cluster corresponds tothe transition to the new state.

After step 1035, processing may return to step 1025 to determine agoodness of fit of the state model (now with three states) to thedevice. Since the state model now has two operating states (states 2 and3), a wattage model may be computed for each operating state, and thewattage models may each be compared with a portion of the smart-plugpower monitoring signal. For example, the wattage model for state 2 maybe compared with portion 1210 of FIG. 12B and the wattage model forstate 3 may be compared with portion 1220. Portions 1210 and 1220 may beidentified from the power monitoring signal using any appropriatetechniques, such as by identifying the portions using power events orselecting portions that provide a best fit to the wattage models. Wherethe goodness of fit is still not sufficient, processing may againproceed to step 1030 to add another state to the model. Where thegoodness of fit is sufficient, processing may proceed to step 1040.

At step 1040, transition models are trained for each selected cluster,and at step 1045, the transition models are used to identify statechanges of devices. Steps 1040 and 1045 may use any of the techniquesdescribed herein, such as any of the techniques of FIG. 9 .

In some implementations, a state model may be initialized with more thantwo states instead of initializing the state model with two states asdescribed above. Any appropriate techniques may be used to determine aninitial number of states.

In some implementations, an initial number of states may be determinedby looking for transitions in examples of the smart-plug powermonitoring signal. For example, portions of the smart-plug powermonitoring signal may be obtained where each portion begins near atransition from zero power to non-zero power (a device turning on) andends near a subsequent transition from non-zero power to zero power (adevice turning off). For each portion of the smart-plug power monitoringsignal, power events between the device turning on and off may beidentified (internal power events), using any techniques describedherein. For each portion, the number of states in the portion may bedetermined to be two more than the number of internal power events. Forexample, with no internal power events, the number of states of theportion may be two (on and off), and with one internal power event, thenumber of states may be three. The numbers of states for the portions ofthe smart-plug power monitoring signals may be combined to determine aninitial number of states for the state model. For example, the initialnumber of states may be a statistic (e.g., mean or median) or a maximumor minimum of the states for the portions.

In some implementations, an initial number of states may be determinedusing the times of power events in the clusters. For example, a firstcluster may be selected using turn-on times as described at step 940,and a second cluster may be selected using turn-off times as describedat step 945. For each of the other clusters, it may be determined howoften the power events of the clusters are between a turn-on time and asubsequent turn-off time. Where a percentage or fraction of power eventsin a cluster that are between a turn-on time and a subsequent turn-offtime is high (e.g., exceeding a threshold), it may be determined thatthe cluster likely corresponds to a state change of a device while thedevice is on and that the device has more than one operating state (inaddition to an on state). The initial number of states for the statemodel may be determined to be two more than the number of clusters thatlikely correspond to a state change of a device while the device is on.For example, where no clusters likely correspond to a state change of adevice while the device is on, the initial number of states may be two(on and off), and where one cluster likely corresponds to a state changeof a device while the device is on, the initial number of states may bethree.

After determining an initial number of states, where the number ofinitial states is more than two (e.g., there is more than one operatingstate), the processing of FIG. 9 may be adapted to train additionaltransition models. As in FIG. 9 , a first transition model may betrained using a cluster corresponding to the turn-on times, and a secondtransition model may be trained using a cluster corresponding to theturn-off times. For each state in addition to two states, a cluster maybe selected using the event times of the clusters (e.g., by comparingthe event times to the turn-on and turn-off times), and a transitionmodel may be trained using the power events of the selected cluster. Insome implementations, the processing of FIG. 10 may be used to determineto add additional states, and the number of states may be increasedbeyond the initial number of states.

In some implementations, it may be determined that the initial number ofstates was too high, and the number of states may be decreased. Forexample, when selecting a cluster, it may be determined that there is nosuitable cluster for a state transition (e.g., based on comparing theevent times of the available clusters to the turn-on and turn-offtimes), and as a result, the number of states may be reduced.

In some implementations, transition models may be trained as describedin the following clauses and combinations of any two or more of them.

Implementation

Variations of the techniques described above are possible. Although thetechniques described above reference a single smart plug, the techniquesmay be adapted to use with more than one smart plug in a building. Forexample, a power monitor may establish network connections with two ormore smart plugs, receive a smart-plug power monitoring signal from eachof the smart plugs, and perform any of the techniques described abovefor each smart-plug power monitoring signal.

Any of the techniques described above may also be implemented with asmart circuit breaker instead of a smart plug. A smart circuit breakermay provide information about power consumption for devices that receivepower from the circuit breaker. A smart circuit breaker, for example,may be installed into an electrical panel and provide power to one ormore devices via the electrical circuit that is connected to the smartcircuit breaker. A smart circuit breaker can include functionality toprovide information about the power provided to the devices that receivepower from the smart circuit breaker. For example, the smart circuitbreaker may include one or more sensors that measure electricalproperties (e.g., current, voltage, or power) of the electricityprovided to the circuit. The sensor data may be used to determine anamount of power consumed by the devices connected to the circuit overtime. The smart circuit breaker may also have a network connection(e.g., Wi-Fi or Bluetooth) to transmit information about the power usageof the connected device to other devices, such as a smart phone. A smartcircuit breaker may have other functionality as well. For example, asmart circuit breaker may have an electrical relay to start and stop theflow of electricity to the circuit, and a user may have an application(or “app”) on a smart phone that allows a user to control the relay.

As used herein, a smart circuit breaker is a device that receiveselectrical power from a main of a building (e.g., via first-main bus bar211 of FIG. 2 ), provides power to a circuit, has a sensor to measureinformation about power transmitted to the one or more devices connectedto the circuit, and has a network connection (wired or wireless) totransmit information about the measured power consumption to otherdevices, such as a power monitor. A smart circuit breaker may alsoprovide other functionality, such as allowing a user to effectivelydisconnect power to the circuit by opening a relay in the smart circuitbreaker.

A power monitor may establish a network connection with a smart circuitbreaker (or multiple smart circuit breakers) and receive asmart-circuit-breaker power monitoring signal from the smart circuitbreaker. Where the power monitor is installed near the smart circuitbreaker (e.g., in or near an electrical panel), the power monitor mayreceive sensor data directly from the smart circuit breaker, and anetwork connection may not be needed.

A smart-circuit-breaker power monitoring signal may be processed usingany of the techniques described above for a smart-plug power monitoringsignal. Because a smart circuit breaker provides power to a circuit (ascompared to a smart plug that provides power to one or more devicesconnected to it), a smart-circuit-breaker power monitoring signal mayindicate power consumption of a larger number of devices than asmart-plug power monitoring signal. Extending the techniques describedabove to a smart-circuit-breaker power monitoring signal isstraightforward to one of skill in the art.

FIG. 13 illustrates components of some implementations of a computingdevice 1300 that may be used for any of a power monitor or a server thatoperates in conjunction with a power monitor. In FIG. 13 , thecomponents are shown as being on a single computing device, but thecomponents may be distributed among multiple computing devices, such asamong any of the devices mentioned above or among several servercomputing devices.

Computing device 1300 may include any components typical of a computingdevice, such as one or more processors 1311, volatile or non-volatilememory 1310, and one or more network interfaces 1312 for connecting tocomputer networks. Computing device 1300 may also include any input andoutput components, such as displays, keyboards, and touch screens.Computing device 1300 may also include a variety of components ormodules providing specific functionality, and these components ormodules may be implemented in software, hardware, or a combinationthereof. Below, several examples of components are described for oneexample implementation, and other implementations may include additionalcomponents or exclude some of the components described below.

Computing device 1300 may include a power event processing component1320 that may be used to process power monitoring signals and determineinformation about devices from the power monitoring signals, such asidentifying devices and device state changes. Computing device 1300 mayinclude a network event processing component 1321 that may be used toprocess data from a computer network and determine information aboutdevices from the network data, such as identifying devices and devicestate changes. Computing device 1300 may include a main identificationcomponent 1322 that may be used to identify a main from which a smartplug is receiving power. Computing device 1300 may include a deviceidentification component 1323 that may be used to identify a device thatis receiving power from a smart plug. Computing device 1300 may have astate change component 1324 that may be used to determine a device statechange corresponding to a power event using a main power monitoringsignal and a smart-plug power monitoring signal. Computing device 1300may have a model training component 1325 that may be used to trainmathematical models for a device using a main power monitoring signaland a smart-plug power monitoring signal.

Computing device 1300 may include or have access to various data stores,such as data stores 1330, 1331, and 1332. Data stores may use any knownstorage technology such as files, relational databases, non-relationaldatabases, or any non-transitory computer-readable media. For example,computing device 1300 may have a power models data store 1330 to storepower models or information about power models. Computing device 1300may have a network models data store 1331 to store network models orinformation about network models. Computing device 1300 may have adevice information data store 1332 that may be used to store informationabout devices, such as device lists for one or more buildings.

While only a few embodiments of the present invention have been shownand described, it will be obvious to those skilled in the art that manychanges and modifications may be made thereunto without departing fromthe spirit and scope of the present disclosure as described in thefollowing claims. All patent applications and patents, both foreign anddomestic, and all other publications referenced herein are incorporatedherein in their entireties to the full extent permitted by law.

The methods and systems described herein may be deployed in part or inwhole through a machine that executes computer software, program codes,and/or instructions on a processor. The processor may be part of aserver, cloud server, client, network infrastructure, mobile computingplatform, stationary computing platform, or other computing platform. Aprocessor may be any kind of computational or processing device capableof executing program instructions, codes, binary instructions and thelike. The processor may be or include a signal processor, digitalprocessor, embedded processor, microprocessor or any variant such as aco-processor (math co-processor, graphic co-processor, communicationco-processor and the like) and the like that may directly or indirectlyfacilitate execution of program code or program instructions storedthereon. In addition, the processor may enable execution of multipleprograms, threads, and codes. The threads may be executed simultaneouslyto enhance the performance of the processor and to facilitatesimultaneous operations of the application. By way of implementation,methods, program codes, program instructions and the like describedherein may be implemented in one or more thread. The thread may spawnother threads that may have assigned priorities associated with them;the processor may execute these threads based on priority or any otherorder based on instructions provided in the program code. The processormay include memory that stores methods, codes, instructions and programsas described herein and elsewhere. The processor may access a storagemedium through an interface that may store methods, codes, andinstructions as described herein and elsewhere. The storage mediumassociated with the processor for storing methods, programs, codes,program instructions or other type of instructions capable of beingexecuted by the computing or processing device may include but may notbe limited to one or more of a CD-ROM, DVD, memory, hard disk, flashdrive, RAM, ROM, cache and the like.

A processor may include one or more cores that may enhance speed andperformance of a multiprocessor. In embodiments, the process may be adual core processor, quad core processors, other chip-levelmultiprocessor and the like that combine two or more independent cores(called a die).

The methods and systems described herein may be deployed in part or inwhole through a machine that executes computer software on a server,cloud server, client, firewall, gateway, hub, router, or other suchcomputer and/or networking hardware. The software program may beassociated with a server that may include a file server, print server,domain server, internet server, intranet server and other variants suchas secondary server, host server, distributed server and the like. Theserver may include one or more of memories, processors, computerreadable media, storage media, ports (physical and virtual),communication devices, and interfaces capable of accessing otherservers, clients, machines, and devices through a wired or a wirelessmedium, and the like. The methods, programs or codes as described hereinand elsewhere may be executed by the server. In addition, other devicesrequired for execution of methods as described in this application maybe considered as a part of the infrastructure associated with theserver.

The server may provide an interface to other devices including, withoutlimitation, clients, other servers, printers, database servers, printservers, file servers, communication servers, distributed servers andthe like. Additionally, this coupling and/or connection may facilitateremote execution of program across the network. The networking of someor all of these devices may facilitate parallel processing of a programor method at one or more location without deviating from the scope ofthe disclosure. In addition, any of the devices attached to the serverthrough an interface may include at least one storage medium capable ofstoring methods, programs, code and/or instructions. A centralrepository may provide program instructions to be executed on differentdevices. In this implementation, the remote repository may act as astorage medium for program code, instructions, and programs.

The software program may be associated with a client that may include afile client, print client, domain client, internet client, intranetclient and other variants such as secondary client, host client,distributed client and the like. The client may include one or more ofmemories, processors, computer readable media, storage media, ports(physical and virtual), communication devices, and interfaces capable ofaccessing other clients, servers, machines, and devices through a wiredor a wireless medium, and the like. The methods, programs or codes asdescribed herein and elsewhere may be executed by the client. Inaddition, other devices required for execution of methods as describedin this application may be considered as a part of the infrastructureassociated with the client.

The client may provide an interface to other devices including, withoutlimitation, servers, other clients, printers, database servers, printservers, file servers, communication servers, distributed servers andthe like. Additionally, this coupling and/or connection may facilitateremote execution of program across the network. The networking of someor all of these devices may facilitate parallel processing of a programor method at one or more location without deviating from the scope ofthe disclosure. In addition, any of the devices attached to the clientthrough an interface may include at least one storage medium capable ofstoring methods, programs, applications, code and/or instructions. Acentral repository may provide program instructions to be executed ondifferent devices. In this implementation, the remote repository may actas a storage medium for program code, instructions, and programs.

The methods and systems described herein may be deployed in part or inwhole through network infrastructures. The network infrastructure mayinclude elements such as computing devices, servers, routers, hubs,firewalls, clients, personal computers, communication devices, routingdevices and other active and passive devices, modules and/or componentsas known in the art. The computing and/or non-computing device(s)associated with the network infrastructure may include, apart from othercomponents, a storage medium such as flash memory, buffer, stack, RAM,ROM and the like. The processes, methods, program codes, instructionsdescribed herein and elsewhere may be executed by one or more of thenetwork infrastructural elements.

The methods, program codes, and instructions described herein andelsewhere may be implemented on a cellular network having multiplecells. The cellular network may either be frequency division multipleaccess (FDMA) network or code division multiple access (CDMA) network.The cellular network may include mobile devices, cell sites, basestations, repeaters, antennas, towers, and the like. The cell networkmay be a GSM, GPRS, 3G, EVDO, mesh, or other networks types.

The methods, programs codes, and instructions described herein andelsewhere may be implemented on or through mobile devices. The mobiledevices may include navigation devices, cell phones, mobile phones,mobile personal digital assistants, laptops, palmtops, netbooks, pagers,electronic books readers, music players and the like. These devices mayinclude, apart from other components, a storage medium such as a flashmemory, buffer, RAM, ROM and one or more computing devices. Thecomputing devices associated with mobile devices may be enabled toexecute program codes, methods, and instructions stored thereon.Alternatively, the mobile devices may be configured to executeinstructions in collaboration with other devices. The mobile devices maycommunicate with base stations interfaced with servers and configured toexecute program codes. The mobile devices may communicate on a peer topeer network, mesh network, or other communications network. The programcode may be stored on the storage medium associated with the server andexecuted by a computing device embedded within the server. The basestation may include a computing device and a storage medium. The storagedevice may store program codes and instructions executed by thecomputing devices associated with the base station.

The computer software, program codes, and/or instructions may be storedand/or accessed on machine readable media that may include: computercomponents, devices, and recording media that retain digital data usedfor computing for some interval of time; semiconductor storage known asrandom access memory (RAM); mass storage typically for more permanentstorage, such as optical discs, forms of magnetic storage like harddisks, tapes, drums, cards and other types; processor registers, cachememory, volatile memory, non-volatile memory; optical storage such asCD, DVD; removable media such as flash memory (e.g. USB sticks or keys),floppy disks, magnetic tape, paper tape, punch cards, standalone RAMdisks, Zip drives, removable mass storage, off-line, and the like; othercomputer memory such as dynamic memory, static memory, read/writestorage, mutable storage, read only, random access, sequential access,location addressable, file addressable, content addressable, networkattached storage, storage area network, bar codes, magnetic ink, and thelike.

The methods and systems described herein may transform physical and/oror intangible items from one state to another. The methods and systemsdescribed herein may also transform data representing physical and/orintangible items from one state to another, such as from usage data to anormalized usage dataset.

The elements described and depicted herein, including in flow charts andblock diagrams throughout the figures, imply logical boundaries betweenthe elements. However, according to software or hardware engineeringpractices, the depicted elements and the functions thereof may beimplemented on machines through computer executable media having aprocessor capable of executing program instructions stored thereon as amonolithic software structure, as standalone software modules, or asmodules that employ external routines, code, services, and so forth, orany combination of these, and all such implementations may be within thescope of the present disclosure. Examples of such machines may include,but may not be limited to, personal digital assistants, laptops,personal computers, mobile phones, other handheld computing devices,medical equipment, wired or wireless communication devices, transducers,chips, calculators, satellites, tablet PCs, electronic books, gadgets,electronic devices, devices having artificial intelligence, computingdevices, networking equipment, servers, routers and the like.Furthermore, the elements depicted in the flow chart and block diagramsor any other logical component may be implemented on a machine capableof executing program instructions. Thus, while the foregoing drawingsand descriptions set forth functional aspects of the disclosed systems,no particular arrangement of software for implementing these functionalaspects should be inferred from these descriptions unless explicitlystated or otherwise clear from the context. Similarly, it will beappreciated that the various steps identified and described above may bevaried, and that the order of steps may be adapted to particularapplications of the techniques disclosed herein. All such variations andmodifications are intended to fall within the scope of this disclosure.As such, the depiction and/or description of an order for various stepsshould not be understood to require a particular order of execution forthose steps, unless required by a particular application, or explicitlystated or otherwise clear from the context.

The methods and/or processes described above, and steps thereof, may berealized in hardware, software or any combination of hardware andsoftware suitable for a particular application. The hardware may includea general purpose computer and/or dedicated computing device or specificcomputing device or particular aspect or component of a specificcomputing device. The processes may be realized in one or moremicroprocessors, microcontrollers, embedded microcontrollers,programmable digital signal processors or other programmable device,along with internal and/or external memory. The processes may also, orinstead, be embodied in an application specific integrated circuit, aprogrammable gate array, programmable array logic, or any other deviceor combination of devices that may be configured to process electronicsignals. It will further be appreciated that one or more of theprocesses may be realized as a computer executable code capable of beingexecuted on a machine readable medium.

The computer executable code may be created using a structuredprogramming language such as C, an object oriented programming languagesuch as C++, or any other high-level or low-level programming language(including assembly languages, hardware description languages, anddatabase programming languages and technologies) that may be stored,compiled or interpreted to run on one of the above devices, as well asheterogeneous combinations of processors, processor architectures, orcombinations of different hardware and software, or any other machinecapable of executing program instructions.

Thus, in one aspect, each method described above and combinationsthereof may be embodied in computer executable code that, when executingon one or more computing devices, performs the steps thereof. In anotheraspect, the methods may be embodied in systems that perform the stepsthereof, and may be distributed across devices in a number of ways, orall of the functionality may be integrated into a dedicated, standalonedevice or other hardware. In another aspect, the means for performingthe steps associated with the processes described above may include anyof the hardware and/or software described above. All such permutationsand combinations are intended to fall within the scope of the presentdisclosure.

All documents referenced herein are hereby incorporated by reference.

What is claimed is:
 1. An electrical meter comprising: a first sensorfor measuring an electrical property of a first electrical main, whereinthe first electrical main provides power to devices in a building; asecond sensor for measuring an electrical property of a secondelectrical main, wherein the second electrical main provides power todevices in the building; a network interface; and at least one processorconfigured to: establish a network connection with a smart plug, whereinthe smart plug receives power from an electrical main of the buildingand provides power to one or more devices; receive a smart-plug powermonitoring signal via the network connection, wherein the smart-plugpower monitoring signal indicates an amount of power provided by thesmart plug to the one or more devices; obtain a first-main powermonitoring signal using measurements from the first sensor; obtain asecond-main power monitoring signal using measurements from the secondsensor; identify a plurality of event times corresponding to events inthe smart-plug power monitoring signal; collect smart-plug portions ofthe smart-plug power monitoring signal corresponding to the plurality ofevent times; collect first-main portions of the first-main powermonitoring signal corresponding to the plurality of event times; collectsecond-main portions of the second-main power monitoring signalcorresponding to the plurality of event times; and determine that thesmart plug receives power from the first electrical main by comparingthe smart-plug portions with the first-main portions and by comparingthe smart-plug portions with the second-main portions.
 2. The electricalmeter of claim 1, wherein the events correspond to the smart plugtransitioning from providing zero power to providing non-zero power. 3.The electrical meter of claim 1, wherein the at least one processor isconfigured to: compute a plurality of first baseline power consumptionsfor the first-main power monitoring signal, wherein each first baselinepower consumption corresponds to an event time of the plurality of eventtimes; compute a plurality of second baseline power consumptions for thesecond-main power monitoring signal, wherein each second baseline powerconsumption corresponds to an event time of the plurality of eventtimes; and determine that the smart plug receives power from the firstelectrical main using the plurality of first baseline power consumptionsand the plurality of second baseline power consumptions.
 4. Theelectrical meter of claim 3, wherein the at least one processor isconfigured to compute a first baseline power consumption by computing anaverage of the first-main power monitoring signal over a period of timeprior to a corresponding event time.
 5. The electrical meter of claim 1,wherein the at least one processor is configured to modify a first-mainportion by down sampling the first-main portion to match a sampling rateof the smart-plug portions.
 6. The electrical meter of claim 1, whereinthe at least one processor is configured to translate a first-mainportion or a smart-plug portion before comparing the first-main portionand the smart-plug portion.
 7. The electrical meter of claim 1, whereincomparing a first-main portion and a smart-plug portion comprisescomputing a distance between the first-main portion and the smart-plugportion.
 8. The electrical meter of claim 1, wherein comparing afirst-main portion and a smart-plug portion comprises: computing a firstfeature vector for the first-main portion; computing a second featurevector for the smart-plug portion; and computing a distance between thefirst feature vector and the second feature vector.
 9. A system fordetermining an electrical main associated with a smart plug, the systemcomprising: an electrical meter comprising at least one processor and atleast one memory, the electrical meter configured to: establish anetwork connection with the smart plug, wherein the smart plug receivespower from an electrical main of a building and provides power to one ormore devices; receive a smart-plug power monitoring signal via thenetwork connection, wherein the smart-plug power monitoring signalindicates an amount of power provided by the smart plug to the one ormore devices; obtain a first-main power monitoring signal usingmeasurements from a first sensor that measures an electrical property ofa first electrical main of the building; obtain a second-main powermonitoring signal using measurements from a second sensor that measuresan electrical property of a second electrical main of the building;identify a plurality of event times corresponding to events in thesmart-plug power monitoring signal; collect smart-plug portions of thesmart-plug power monitoring signal corresponding to the plurality ofevent times; collect first-main portions of the first-main powermonitoring signal corresponding to the plurality of event times; collectsecond-main portions of the second-main power monitoring signalcorresponding to the plurality of event times; and determine that thesmart plug receives power from the first electrical main by comparingthe smart-plug portions with the first-main portions and by comparingthe smart-plug portions with the second-main portions.
 10. The system ofclaim 9, wherein comparing a first-main portion and a smart-plug portioncomprises computing a distance between the first-main portion and thesmart-plug portion.
 11. The system of claim 9, wherein the electricalmeter is configured to: compare the smart-plug portions with thefirst-main portions by computing a first plurality of distances betweenthe first-main portions and the smart-plug portions; and compare thesmart-plug portions with the second-main portions by computing a secondplurality of distances between the second-main portions and thesmart-plug portions.
 12. The system of claim 11, wherein the electricalmeter is configured to determine that the smart plug receives power fromthe first electrical main by: computing a first value from the firstplurality of distances; computing a second value from the secondplurality of distances; and comparing the first value and the secondvalue.
 13. The system of claim 12, wherein the first value is a mean ora median of the first plurality of distances.
 14. The system of claim 9,wherein the electrical meter is configured to scale an amplitude of afirst-main portion or a smart-plug portion before comparing thefirst-main portion and the smart-plug portion.
 15. Acomputer-implemented method, implemented by an electrical meter, fordetermining an electrical main associated with a smart plug, thecomputer-implemented method comprising: establishing a networkconnection with the smart plug, wherein the smart plug receives powerfrom an electrical main of a building and provides power to one or moredevices; receiving a smart-plug power monitoring signal via the networkconnection, wherein the smart-plug power monitoring signal indicates anamount of power provided by the smart plug to the one or more devices;obtaining a first-main power monitoring signal using measurements from afirst sensor that measures an electrical property of a first electricalmain of the building; obtaining a second-main power monitoring signalusing measurements from a second sensor that measures an electricalproperty of a second electrical main of the building; identifying aplurality of event times corresponding to events in the smart-plug powermonitoring signal; collecting smart-plug portions of the smart-plugpower monitoring signal corresponding to the plurality of event times;collecting first-main portions of the first-main power monitoring signalcorresponding to the plurality of event times; collecting second-mainportions of the second-main power monitoring signal corresponding to theplurality of event times; and determining that the smart plug receivespower from the first electrical main by comparing the smart-plugportions with the first-main portions and by comparing the smart-plugportions with the second-main portions.
 16. The computer-implementedmethod of claim 15, wherein comparing a first-main portion and asmart-plug portion comprises computing a distance between the first-mainportion and the smart-plug portion.
 17. The computer-implemented methodof claim 15, wherein comparing a first-main portion and a smart-plugportion comprises: computing a first feature vector for the first-mainportion; computing a second feature vector for the smart-plug portion;and computing a distance between the first feature vector and the secondfeature vector.
 18. The computer-implemented method of claim 15,comprising identifying a second plurality of times corresponding tosecond events in the smart-plug power monitoring signal.
 19. Thecomputer-implemented method of claim 18, wherein the second eventscorrespond to the smart plug transitioning from providing non-zero powerto providing zero power.
 20. The computer-implemented method of claim15, wherein determining that the smart plug receives power from thefirst electrical main comprises: computing a first baseline powerconsumption, corresponding to an event time, from the first-main powermonitoring signal; computing a normalized first-main portion bysubtracting the first baseline power consumption from a first-mainportion corresponding to the event time; computing a first distancebetween a smart-plug portion corresponding to the event time and thenormalized first-main portion; computing a second baseline powerconsumption, corresponding to the event time, from the second-main powermonitoring signal; computing a normalized second-main portion bysubtracting the second baseline power consumption from a second-mainportion corresponding to the event time; and computing a second distancebetween the smart-plug portion corresponding to the event time and thenormalized second-main portion; wherein determining that the smart plugreceives power from the first electrical main comprises using the firstdistance and the second distance.